Linking combo boxes (1 Viewer)

Robert C

Registered User.
Local time
Today, 05:11
Joined
Mar 27, 2000
Messages
88
On my form I have one combo box which shows a list of product categories and another showing a list of suppliers. What I would like to achieve is that after the product category has been selected, the combo box showing the supplier names only displays those suppliers which fall into the selected product category.

Any help on this would be gratefully received

Many thanks in advance.
 

DMC

Registered User.
Local time
Today, 05:11
Joined
Dec 6, 1999
Messages
23
You need to base your suppliers combobox on a query with fields such as

category
supplier

In the criteria section of the 'category' field in this query insert:

[forms]![Yourformname]![yourcategorycombobox]

This will supply the category from your category combobox and filter out the suppliers. Next you will have to requery the supplier combobox every time you select a new category in the category combobox, you can do this by:

edit the 'on update' event property of the category combobox and select the code builder option and insert:

Me![yoursuppliercomboboxname].requery

This should do want you want.

Cheers

Remember to insert the names of your form and comboboxes where necessary.
 

tacieslik

Registered User.
Local time
Today, 05:11
Joined
May 2, 2001
Messages
244
I wish to do something very similar too but there must be a difference as I've tried this but it did not work.

I have a form with a 'SupplierID' combo box on.
Also, on the same form, I have another Combo box (PartID) but this is in a subform.

The PartID combo box gets it's data from a query record called 'Parts Query' and the SuppliersID comes from a table called 'Suppliers'
I want to select a Supplier from the SupplierID box and then have Access only display the parts that the relevent supplier, supply's.

I would be very grateful for any advice/solutions which you could give me.

Tim Cieslik
 

Users who are viewing this thread

Top Bottom