I want to be able to use a parameter in a query.
If the Parameter is entered the Criteria must match that parameter
If the Parameter is empty, the query should return ALL rows including those with nulls
e.g If Prompt said Enter Status? then if a status is entered only matching rows are returned
If NO value is entered, the query must return ALL rows with an entry in that field as well as those with a null.
If I use a wild card statement : Like IIf([Enter Status] is null,”*”,[Enter Status]) then leaving the field empty eliminates the Nulls
If I use a statement such as : Like IIf([Enter Status] is null,”*”,[Enter Status]) Or Null then nulls are returned, BUT only if a Status is entered
If I use a statement such as : Like IIf([Enter Status] is null,”*”,[Enter Status]) Or Like IIf([Enter Status] is null,Is Null,[Enter Status]) then Only Non Null rows are returned if the box is left blank
Short of constructing the SQL in code from a form rather than trying to use parameters, is there a simple solution that I have just missed?
Any help gratefully appreciated…….
Andrew Walker