Query Criteria

P

Pass-the-Reality

On my query I added criteria that says [Forms]![frmMain]![Combo11] so that
the query will run based on what is selected from the drop down. However, if
the drop down is left blank (no select made). How would I update my criteria
to say than display all?
 
D

Douglas J. Steele

If you're doing this through the grid, you'd change the criteria to

[Forms]![frmMain]![Combo11] OR ([Forms]![frmMain]![Combo11] IS NULL)

The SQL of the query would change from

WHERE SomeField = [Forms]![frmMain]![Combo11]

to

WHERE ((SomeField = [Forms]![frmMain]![Combo11])
OR ([Forms]![frmMain]![Combo11] IS NULL))
 

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