Updating Queries when using a Form (1 Viewer)

diversoln

Registered User.
Local time
Today, 04:11
Joined
Oct 8, 2001
Messages
119
I have a form with combo boxes used to select items for my master table. The first combo box has a list of facilities, say A, B, and C. The second combo box has a list of departments at each facility for example Facility A has D1, D2, and D4, Facility B has D1 and D3, and Facility C has just D1. Depending on the selection for Facility, the combo box for department based on a query shows only the departments that exist for the chosen facility.

This works great at first. But, if the user wants to change their selection for facility for some reason, the list in the department combo box does not update.

I've tried a number of event controls to get the query to rerun so that the list of departments in the combo box will update when the facility is changed but I just can't seem to get this to work. What's the secret ?

Thanks in advance !
 
Last edited:

RichO

Registered Yoozer
Local time
Yesterday, 22:11
Joined
Jan 14, 2004
Messages
1,036
Did you try...

Me.DepartmentCombo.Requery


?
 

diversoln

Registered User.
Local time
Today, 04:11
Joined
Oct 8, 2001
Messages
119
I've given your suggestion a try but I'm having a bit of trouble getting it to work. What event action should the requery be associated with ?

Thanks !
 

RichO

Registered Yoozer
Local time
Yesterday, 22:11
Joined
Jan 14, 2004
Messages
1,036
Try the After Update event for the facilities combo box. See if that works.
 

diversoln

Registered User.
Local time
Today, 04:11
Joined
Oct 8, 2001
Messages
119
Figured it out... I used the On Change Event from the Facility Combo box to first clear the Department Combo box then requery it.

Muchos Gracious !!!

This is very cool - my users will love this improvement
 
R

Rich

Guest
Use the AfterUpdate event as already advised. The OnChange event will fire for every letter typed in
 

Users who are viewing this thread

Top Bottom