Answered by:
Auto-fill and dropdown

Question
-
I have a form that has several combo box which is autofilled based on the update of a particular field. This is working fine, using VBA.
Once the form has autofilled, i would like the user to be able to select a different option for each combo box.
The trick is, the original autofill's source is from one table. The dropdown needs to come from a different table (a linked excel sheet).
The combo box autofill was working fine, but when i defined the row/source table in the dropdown, i could select from the dropdown, but the autfill no longer worked when i updated the filter field.
Is there a better way to do this?
I am familiar with autofilling and combo boxes, but have never had a need to do this combination before
Thanks for any help you can give.
Mary
MS - Teach me to fish
Wednesday, April 20, 2016 7:31 PM
Answers
-
Thanks Edward,
Form is bound to [tbl1]. Combo box [cbo1] based on [xls1]. cbo1.afterupdate has code that uses DLookup of [xls1] to fill [cbo2]. User then selects a value for [cbo2] based on [xls2]. cbo2.afterupdate has code that uses DLookup to fill [txt1] and [txt2].
Very convoluted. My constraint is that the xls tables are linked tables used by others. I cannot 'adapt' the spreadsheets to fit the needs of the database.
I was, however, able to get the above to work.
I will try to be more clear in the future.
MS - Teach me to fish
- Proposed as answer by Edward8520Microsoft contingent staff Tuesday, April 26, 2016 2:42 AM
- Marked as answer by Edward8520Microsoft contingent staff Tuesday, May 3, 2016 2:39 AM
Monday, April 25, 2016 9:27 PM
All replies
-
Hi Mary,
>> The combo box autofill was working fine, but when i defined the row/source table in the dropdown, i could select from the dropdown, but the autfill no longer worked when i updated the filter field.
How did you achieve auto fill? Do you mean when update of a particular field, you will automatically set value for combobox? If so, how did you set? And do you mean after you select value form dropdown, the auto fill would not work? In my option, if you want to set value for combobox, you could use Change event of textbox.
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Thursday, April 21, 2016 5:13 AM -
can you re-state you post without using the term 'autofill' - which has no clear definition and can be interpreted by different people in different ways.
A form is typically bound to its record set (table or query) or is an unbound form. Likewise a combobox has a record set or is unbound.
Comboboxes also have 2 roles - in a single view form - they can exist to select the record for the form itself; or they can be bound to their own record set (independent of the form's record set) to allow multiple choices of a specific field.
Thursday, April 21, 2016 10:28 PM -
Thanks Edward,
Form is bound to [tbl1]. Combo box [cbo1] based on [xls1]. cbo1.afterupdate has code that uses DLookup of [xls1] to fill [cbo2]. User then selects a value for [cbo2] based on [xls2]. cbo2.afterupdate has code that uses DLookup to fill [txt1] and [txt2].
Very convoluted. My constraint is that the xls tables are linked tables used by others. I cannot 'adapt' the spreadsheets to fit the needs of the database.
I was, however, able to get the above to work.
I will try to be more clear in the future.
MS - Teach me to fish
- Proposed as answer by Edward8520Microsoft contingent staff Tuesday, April 26, 2016 2:42 AM
- Marked as answer by Edward8520Microsoft contingent staff Tuesday, May 3, 2016 2:39 AM
Monday, April 25, 2016 9:27 PM -
Hi Mary,
>> My constraint is that the xls tables are linked tables used by others. I cannot 'adapt' the spreadsheets to fit the needs of the database
Yes, if you link a table in Access to xls file, you could not update this table from Access.
>> I was, however, able to get the above to work.
Do you mean your original issue has been resolved? If so, I suggest you mark helpful reply as answer to close this thread.
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Tuesday, April 26, 2016 2:42 AM