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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query with empty criteria

Status
Not open for further replies.

valterduarte

Technical User
Nov 25, 2005
15
0
0
PT
Hello!

I'm sure this has been answerd before but I can't find any thread with this information:

I have a query with two criterias, wich are obtained from dialog boxes.

The queria gives me the result of Criteria A AND Criteria B.

However, sometimes I want to leave one of the criterias blank. In these cases I think the query looks for all the record with an empty field in that criteria which is not what I'm looking for.

Can anyone help me?

Thank you!
 
If you are passing criteria from a form then it will be something like..
Code:
[Forms]![myForm]![myControl] OR [Forms]![myForm]![myControl] Is Null

________________________________________________________
Zameer Abdulla
Help to find Missing people
Even a thief takes ten years to learn his trade.
 
I've been able to solve the problem with:

Like IIF([Parameter A] is Null,"*",[Parameter A])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top