The criteria in my query references some fields on a search form. What I need it to do is if Text24 is null, select all values from the table including null value fields. If Text24 is not null, select the records where FieldA = Text24. I tried to use an IIF statement, but I would either get no records returned or an error. This is the IIF statement I was using:
IIf(IsNull([forms]![searchmenu]![text24]),Like "*" & [forms]![searchmenu]![text24] & "*" Or Is Null,[forms]![searchmenu]![text24])
Any suggestions? It's important that the records with null values ONLY be included when Text24 on the search form is null.
IIf(IsNull([forms]![searchmenu]![text24]),Like "*" & [forms]![searchmenu]![text24] & "*" Or Is Null,[forms]![searchmenu]![text24])
Any suggestions? It's important that the records with null values ONLY be included when Text24 on the search form is null.