Update Combo Box 2 from Combo Box 1 (1 Viewer)

Nicola

New member
Local time
Today, 00:34
Joined
Oct 3, 2000
Messages
8
I have a table (SiteTable) which contains a list of all sites. I have another table (RecieptsTable) which contains a list of suppliers for each site.

Combo box 1 allows me to select a site using SiteTable as the record source.

From ReceiptsTable I want Combo box 2 to then present the user with a list of all suppliers to the site that has been selected in combo box 1.

I have a query which does this. i.e. when I select a site in combo box 1 and then run the query from the database window it lists all suppliers associated with that site, but when I click on combo box 2 (whose record source is the query) it doesn't work. Or rather it does work, but it doesn't change the suppliers listed in combo box 2 when the site selection in combo box 1 changes.

I have searched through this forum but can't find the answer to my problem.

Any advice would be greatly appreciated!
 

Angello Pimental

Registered User.
Local time
Today, 00:34
Joined
May 9, 2001
Messages
92
Nicola, you need to requery combobox2.

So put:

Me!combobox2.requery

In the after_update of combobox1.

HTH

Angelo
 

Nicola

New member
Local time
Today, 00:34
Joined
Oct 3, 2000
Messages
8
Brilliant, excellent, fantastic!

Thank you very much.

Nicola
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 19:34
Joined
Feb 19, 2002
Messages
43,308
You also need to requery the combobox in the OnCurrent event of the Form to make sure that the second combobox is in sync with the first even when the first did not change.

Me.combobox2.requery
 

Users who are viewing this thread

Top Bottom