Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

qry in cbo on form 1

Status
Not open for further replies.

jacko999

Technical User
Apr 30, 2007
32
0
0
GB
i have a combo box on my form linked into my query and when all is selected i want my query to select all possible field how do i do this

Chris :D
 
If I understand your question correctly, you can set your criteria in the query to:

Forms!MyForm!a Or Forms!MyForm!a = "all"

If this doesn't resolve your issue, come back with the
-form name
-combo box name
-Row Source of combo box
-field in query to set criteria against

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
How is the user selecting "all"? Are you using a union query for the combo?

For example, say you want to select a Country in your combo, and also offer 'all', you could set the combo's rowsource to something like:

SELECT Country
FROM myTable
UNION
SELECT "[All]" FROM myTable
ORDER BY Country

In your query, you could use as criteria:

Like Iif(Forms!myForm!myCombo="[All]","*",Forms!myForm!myCombo)

HTH

Max Hugen
Australia
 
Max, your criteria excludes the null values even if ALL is expected, so I'd use this instead;
=Forms!myForm!myCombo OR Forms!myForm!myCombo='[All]'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top