"All" in Combo Box

Dominato

Registered User.
Local time
Today, 17:29
Joined
Apr 10, 2002
Messages
19
I have a form that opens up with 3 different combo boxes. Each combo box is populated by a different column from a table. The user selects a value for each of the three combo boxes, then clicks a button. What this does is opens a query that checks the value of each combo boxes and filters the data appropriately depending what was selected. It acts as an "and" filter. Meaning the query shows all records the have the value of the first combo box, and the value of the second, and the value of the third. This works fine. What I need to do is somehow have either a blank value or the value "All" in each of the combo boxes so that people can query using only two parameters, or one parameter. Any ideas?
 
Okay, so your code in your criteria section is going to look something like this.

fldFilter1
=IIF([Form]![cbo1] <>"", [Form]![cbo1])

fldFilter2
=IIF([Form]![cbo2] <>"", [Form]![cbo2])

fldFilter3
=IIF([Form]![cbo3] <>"", [Form]![cbo3])

So therefore, it will only filter on that field if the combo box has a value in it.

The combo boxes displaying a blank part is easy if the combo boxes are built from tables.... and you just put in a blank record or the word "ALL". If you want to use "ALL" of course, then you would modify the above code appropriately.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom