Showing related records only

K

kassie

I am trying to create a form, where 2 fields are filled from comboboxes,
which are related. Eg. one may contain makes, and the other models. If the
user selects a specific make from the first combobox, I want the second
combobox to only show models related to that make. How do I do this?
 
A

Al Camp

kassie,
Use the value of combo1 (ex. cboMake) to filter the contents of combo2 (ex. cboModel).
In your example, in the query behind cboModel, you would filter the Make field with a
criteria of...
= Forms!YourFormName!cboMake
Also, always use a
cboModel.Requery
command on the AfterUpdate event of cboMake... so that whenever a selection is made in
cboMake... cboModel will be correctly filtered.

On my website below, I have a sample file that demonstrates this "Synched Combos"
technique.
 
R

RuralGuy

I am trying to create a form, where 2 fields are filled from comboboxes,
which are related. Eg. one may contain makes, and the other models. If the
user selects a specific make from the first combobox, I want the second
combobox to only show models related to that make. How do I do this?

Cascading ComboBoxes: http://www.fontstuff.com/access/acctut10.htm
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
R

Rick B

Asked and answered very very often.

Please read the previous posts before starting a new thread. A search for
"cascading combo" or "dependant combo" will most likely get you several
examples.
 
Top