Filtering Combo box linked to another by results

G

Guest

I have created a subform to a form, which has two combo boxes. The tables underlying the information in these combo boxes are related. I want the catergory picked in the first combo box (Company) to limit the subcategory options in the second combo box (Employee Name). How do I do this?
Also, once the employee name has been elected, I want the associated EmployeeID to appear in as a record in a table, linked to a Retailer'sID (the Retailer'sID data is held in the main form). I have already created a table for this.
 
J

Jim Shaw

Re: one combo box dependent on another

1. Define both combo boxes as normal, unrestricted table lookup types. This
will cause a SELECT statement to be generated for both in their row source
property.
2. In the dependent combo box's SELECT statement, add a WHERE clause
referencing the dominant combo box's value. You might also want to disable
this control (but managing that is another story).
3. In the OnClick event for the dominant combo box, enter a command to
requery the dependent combo box. You might want to enable the dependent
combo box at this time too.

I had a similar need for this in my db , but my dominant control was an
option box.
-Jim


mima said:
I have created a subform to a form, which has two combo boxes. The tables
underlying the information in these combo boxes are related. I want the
catergory picked in the first combo box (Company) to limit the subcategory
options in the second combo box (Employee Name). How do I do this?
Also, once the employee name has been elected, I want the associated
EmployeeID to appear in as a record in a table, linked to a Retailer'sID
(the Retailer'sID data is held in the main form). I have already created a
table for this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top