Query Criteria Return both "*" and null fields

joeKra

Registered User.
Local time
Today, 15:54
Joined
Jan 24, 2012
Messages
208
Hi,
i need help for this criteria, in the false part it should return anything even its null, i tried adding "*" or is null does not work,
any help??

thanks in advance:


Code:
Like IIf([Forms]![Master].[Customers_Panel].[Form]![cmbSearchBY]=3,'*' & [Forms]![Master].[Customers_Panel].[Form]![txtSearch] & '*',[COLOR="Red"]'*'[/COLOR])
 
OK, will you tell us how it does not work?
What is it not doing that you would like it to do.

Also the quote are not needed I don't think.


Dale
 
i want in the false part of the iiF it should return everything even null values, because its filtering on another field, and if i am adding the "*" in the false part , it will only return fields having some value
 
is there any other criteria in the query?
Can you copy and paste the SQL from this query.

Dale
 
The following should get you closer to the correct syntax (ditch the IIf()) but I don't have enough information from what you posted to create the exact clause you need. Notice the parentheses that surround the first condition. They are required whenever your condition includes AND, OR, and NOT operands to specify the order of evaluation.

WHERE ([Forms]![Master].[Customers_Panel].[Form]![cmbSearchBY] = 3 AND SomeField Like "*" & [Forms]![Master].[Customers_Panel].[Form]![txtSearch] & '*') OR SomeField Is Null
 
Thanks for the help Pat.

Queries are not my long suit.

Dale
 

Users who are viewing this thread

Back
Top Bottom