I'm new to VBA and beginning to understand the basics, however, I'm having trouble opening a form from the main menu (which is just a form without a record source) where one of the fields is null/blank. I'm using a button with an on-click event to make this happen.
I'm able to open a form by setting the field to a specific value to open all the records that have that value. For example, the below code works:
DoCmd.OpenForm "frm_Projects" , , , "Status='Active'"
However, I have a notes field in a form and when that field is null/empty, I want it to display only those records. The other fields can be filled out.
I've tried the following:
(1) Loads a blank form as if I'm trying to add a new record
DoCmd.OpenForm "frm_Project", , ,"txt_Notes='Is Null"
(2) Gives me a "Run-time error '2450':"
If IsNull([Forms]![frm_Project]![txt_Notes]) Then
DoCmd.OpenForm "frm_Project"
Else
MsgBox "Some text"
End If