PDA

View Full Version : Filter data based on the selection in a lookup?


LoriD
05-17-2002, 01:18 PM
This is where I m getting lost: I want to create a form that chooses the equipment, then adds a maintenance record for that piece of equipment. I think I know how to do the 2nd piece (from posting here before).
But for the 1st piece, I want the user to select the equipment, (grader, backhoe or plow) then choose the unit number.
But I don t want them to have to scroll through all the unit numbers (500+). If they have selected backhoes, I want them to see a list of backhoe unit numbers only, so they can then select the unit number they want.
(That s why I thought I had to have multiple tables.)
Is there a way for me to do this?

ST
05-17-2002, 03:30 PM
LoriD,
Based on your description, I believe you need a Query by Form setup.
First, you would create a query containing the Equipment and Unit# fields. For the criteria of the Equipment field you would refer to the Equipment list (or combo) box on the form by entering the following...

[forms]![FORM NAME HERE]![EQUIPMENT LISTBOX CONTROL NAME HERE]

Then you would create the Unit# list (or combo) box on the form, basing it on the query you just created (Hiding the Equipment Column). Note: The form must be opened for the query to run. Good Luck!

ST

RoverM
05-17-2002, 06:38 PM
You can also fill the second combobox based on a query and let that query refresh in the Change events of the first combo (items).

Or, in the same event, set the filter property of the second combo.


D Mzzl!
RoverM