IIf and Isnull in expression builder

JBurlison

Registered User.
Local time
Today, 13:42
Joined
Mar 14, 2008
Messages
172
Basically i have a drop down that i want controlling the Criteria for each field in my query to have an advanced search. If i leave a field blank the query comes up with nothing so i tried this:

Code:
IIf(IsNull([Forms]![Inventory Report Search]![Model]),Is Null,[Forms]![Inventory Report Search]![Model])

this is not working. it is still returning the query blank. if i put valid critera in the dropdown it comes back Fine.how do i make is so if a field is blank it will return it as null or not even there.

Note: also tried this;

Code:
Forms]![Inventory Report Search]![Model] Or Forms]![Inventory Report Search]![Model] Is Null

works, But comes back as too complex after a few searches and when i open the query there is a million or's in there. so that wont work.
 
Last edited:
Why are you even using an IIF? It looks like you want whatever the field has to offer in either case.
 
Why are you even using an IIF? It looks like you want whatever the field has to offer in either case.

yah but if the field is empty it includes "" as part of the search so the search comes up with no records because no fields are "". i need Null to null out the "" so the records show
 

Users who are viewing this thread

Back
Top Bottom