Return records based on user input

shaggy

Registered User.
Local time
Today, 01:18
Joined
Sep 9, 2002
Messages
41
WHERE iif([Enter value] is null, [FieldName] is null, [FieldName]=[Enter value])

The above works to return records with a value entered for a field, or all records with a null value in that field if there is no user input.
-----------------------------------------------------------------------------------------------------------------------------
I'm now trying to return records with a value entered for a field or any non-null value in that field if there is no user input.

WHERE iif([Enter value] is null, [FieldName] is not null, [FieldName]=[Enter value])

The above works if a value is entered, but not if there is no user input. Any help would be greatly appreciated.
 
Try:

WHERE iif(IsNull([Enter value]), [FieldName], [FieldName]=[Enter value])
 

Users who are viewing this thread

Back
Top Bottom