Solved how to only filter a field if its not null, if not null then filter the query

Sodslaw

Registered User.
Local time
Today, 09:04
Joined
Jun 7, 2017
Messages
85
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
 
@Gasman Brilliant thank you, Sir! The Like method worked a treat
 
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 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

Back
Top Bottom