Create a criteria in a query, based in a combobox.

G

Guest

I use a criteria in a query colum to filter some data.
My combobox there are a option to chose. Based in the opition that I chose,
the query execute the filter.
But, I would like that there are the option "All" in my combobox, like the
dinamic table in a excel.

Exemple:
itens that I want in my combobox [Forms]![xxx]![Combo1]:
1-All
2-A
3-B
4-C
5-D

If I click in the combobox empt option, the query dosent undertand that I
want All records.

I dont get to input the all option.

How To procedure?
 
G

Guest

In the Criteria try

Like IIf([Forms]![xxx]![Combo1]=1 , "*",[Forms]![xxx]![Combo1])

So if it 1 (All) it will assign * that return all records

Or, another option

Where FieldName = [Forms]![xxx]![Combo1] Or [Forms]![xxx]![Combo1] = 1
 

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