Solved how to only filter a field if its not null, if not null then filter the query (1 Viewer)

Sodslaw

Registered User.
Local time
Today, 03:47
Joined
Jun 7, 2017
Messages
81
I have a form that opens a query. In the query, there is a filter...
[Forms]![FrmNote]![AC_No]

1598267468835.png

Target objective
If in the form [AC_No] is null then show data for all CustomerID in the query
however if [AC_No] is not null then it displays the query for a specific CustomerID that is defined in the [Forms]![FrmNote]![AC_No]

to me, it sounds simple but I am having issues in making it work.
Any Ideas? thanks in advance
 

Sodslaw

Registered User.
Local time
Today, 03:47
Joined
Jun 7, 2017
Messages
81
@Gasman Brilliant thank you, Sir! The Like method worked a treat
 

jdraw

Super Moderator
Staff member
Local time
Today, 06:47
Joined
Jan 23, 2006
Messages
15,385
You may also find this Steve Bishop video useful. He shows the filtering technique around the 18:30 point in the video. He has many Ms Access videos on youtube.
 

Gasman

Enthusiastic Amateur
Local time
Today, 11:47
Joined
Sep 21, 2011
Messages
14,362
@Gasman Brilliant thank you, Sir! The Like method worked a treat
No need for a like unless you want to search within a field?
To get all records when the control is NULL, just use that extra criteria for the form control being Null?
 

Users who are viewing this thread

Top Bottom