Re: Multiple search Criteria
- From: John Spencer <spencer@xxxxxxxxxx>
- Date: Mon, 16 Feb 2009 14:41:15 -0500
Well, you can't do it that way. IF the field you are searching against always has a value (no nulls allowed) and the field is a text field then you can use criteria like the following.
LIKE NZ([Forms]![frmRunSites]![FindId],"*")
Alternative is to use
= [Forms]![frmRunSites]![FindId] or [Forms]![frmRunSites]![FindId] is Null
The problem with the alternative above is that if you use the construct many times the query will quickly grow too complex and will not run.
If the field is a date value and always has a value (no nulls) and you know the maximum range of the dates you can use something like the following.
Between NZ([Forms]![frmRunSites]![SomeDate],#1800-01-01#) and NZ([Forms]![frmRunSites]![SomeDate],#3000-01-01#)
The best way to handle this type of situation is to use VBA to build the criteria. Allen Browne has an example on his site - unfortunately I can't find the URL right now.
'====================================================
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
Gary S wrote:
If(IsNull([Forms]![frmRunSites]![FindId])=True,"like '*' or is null",[Forms]![frmRunSites]![FindId]).
I am using this in the selection criteria of the query.
- References:
- Multiple search Criteria
- From: Gary S
- Re: Multiple search Criteria
- From: Danny J. Lesandrini
- Re: Multiple search Criteria
- From: Gary S
- Multiple search Criteria
- Prev by Date: Re: compute, assign and total values in a query?
- Next by Date: Re: Multiple search Criteria
- Previous by thread: Re: Multiple search Criteria
- Next by thread: Using a Table as Lookup
- Index(es):
Relevant Pages
|