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

Query criteria with null values

Status
Not open for further replies.

naab0001

MIS
Jan 25, 2005
3
US
Need a little help with programming a search feature for my database.

I'm searching by a date and an order number. My criteria for the two are as follows:

<[Forms]![frmSearch]![txtHiddenDate]

and

[Forms]![frmSearch]![txtfleet]

It works fine, unless I leave one of those fields in frmSearch blank. I want it to return all records if the fields are left blank. I've tried the NZ function in the criteria line, which I've used before with an "*". Doesn't seem to work this time for some reason. Any ideas on how I can get the query to return all the records? Thanks for the help in advance.
 
<[Forms]![frmSearch]![txtHiddenDate] OR [Forms]![frmSearch]![txtHiddenDate] Is Null

=[Forms]![frmSearch]![txtfleet] OR [Forms]![frmSearch]![txtfleet] Is Null

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top