Dropdown box with Selection of All by default

  • Thread starter Thread starter Galco
  • Start date Start date
G

Galco

Would like to have a form with dropdown lists where people can choose their
query selection criteria where if no specific value chosen then looks for all
values or preferably add to the dropdown query list a value of "All"
Have tried:
IIf([forms]![Areas]![Area]="All",Like "*",[forms]![Areas]![Area]")
IIf([forms]![Areas]![Person]="All",Like "*",[forms]![Areas]![Person]")
 
Would like to have a form with dropdown lists where people can choose their
query selection criteria where if no specific value chosen then looks for all
values or preferably add to the dropdown query list a value of "All"
Have tried:
IIf([forms]![Areas]![Area]="All",Like "*",[forms]![Areas]![Area]")
IIf([forms]![Areas]![Person]="All",Like "*",[forms]![Areas]![Person]")

What is the rowsource of the combo box?
A Table or Query?

Note that the symbols <> surround the word "All". That is to have the
list sort with the word <All> at the top of the list before any other
"A" listing.

First add "All" to the drop down list.

As rowsource of the combo box, adapt the following:

Select tblName.Area From tblName Union Select
"<ALL>" from tblName Order by Area;

The above will result in a combo list similar to the following...
<All>
AreaA
AreaB
AreaC
etc...

Then to filter data in the query, change the query criteria to:

Like
IIf([forms]![FormName]![ComboName]="<ALL>","*",[forms]![FormName]![ComboName)

Change the table and field names to your actual table and field names.
The form must be open when the query is run.
 
Back
Top