Combobox - change in selection and On Change event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the result of a combobox selection (Combo1) as a foreign key value for a subsequent combobox (Combo2) query.
The first time a value is selected in Combo1, all is OK. The Combo2 query correctly picks up the foreign key value in the Combo1 field (Criteria in my query is set to [Forms!][FormName]![Combo1] and filters the query result list appropriately. If I go back and change the selection in Combo1 after I have done this, the value in the field is not updated with the new selection - the Combo2 query uses the original selected value. Can I use code in the On Change or After Update event for this control (Combo1) to "force" the update of the field value based on the new selection? If this is do I refer to the selected value in the query using code?
 
Hi,
The usual way to do this is to requery Combo2
in Combo1's AfterUpdate event.

--
HTH
Dan Artuso, Access MVP


Linda said:
I am using the result of a combobox selection (Combo1) as a foreign key value for a subsequent combobox (Combo2) query.
The first time a value is selected in Combo1, all is OK. The Combo2 query correctly picks up the foreign key value in the Combo1
field (Criteria in my query is set to [Forms!][FormName]![Combo1] and filters the query result list appropriately. If I go back and
change the selection in Combo1 after I have done this, the value in the field is not updated with the new selection - the Combo2
query uses the original selected value. Can I use code in the On Change or After Update event for this control (Combo1) to "force"
the update of the field value based on the new selection? If this is do I refer to the selected value in the query using code?
 
Back
Top