combobox updating when another changes value

reyrey

Registered User.
Local time
Yesterday, 20:02
Joined
May 23, 2012
Messages
18
i have a form that has 2 comboboxes. one is for a contractor name and the other is for employee name. how do get the values for the employee to update whenever i change the contractor name combobox? the contractor to employee relationship is one to many. the form uses the contractor table to populate the contractor name combobox. when a record loads, the new employee name dropdown list is correct. when i change the contractor name, it doesnt update. can i link it or run a macro or change the ondirty or onchange settings? thanks.
 
May be this would work:
Put this line of code in the After Update event of the first combo box:
Me.[NameOfSecondComboBox].Requery
 
In the After Update event of the first combo box you requery the second combo box;

Me!YourSecondCombo.Requery

You would also want to do this in the Current event of the form.
 
Damn! I'm too slow. Must be the beer.:D
 
i used macrobuilder to refresh the current record on the onChange field. is that overkill? it there a standard convention reguarding macro utilization as it pertains to where and when? it looks like it does the same thing as you all are suggesting. i will look at the sql code as soon as i can find it. Im still learning. thanks guys
 
I seldom use macros, so I am unable to answer question on them. I normally use VBA code.
 
You don't want to use the On Change event, as it fires at every keystoke. Use the After Update event.
 
You don't want to use the On Change event, as it fires at every keystoke. Use the After Update event.
Quite right. I didn't spot that the OP refered to the On Change event.
Must be my age! :D
 

Users who are viewing this thread

Back
Top Bottom