I would not create a record with empty string in field even if I do intend to immediately open and edit. I would open form with acFormAdd parameter.
I suppose instructor intent was to make use of one form for new and edits and allow for form to open filtered to an existing lot number or a "new" record without having to check if there is a valid lot number provided to filter on.
If Command45 (could use more descriptive name) purpose is to "Add New RM", I would use:
Code:
Private Sub Command45_Click()
DoCmd.OpenForm "RM_ADD_Form", , , acFormAdd
DoCmd.Close acForm, "Landing_Page"
End Sub
Private Sub Update_Lot_Button_Click()
DoCmd.OpenForm "RM_ADD_Form", , , "Lot_Number='" & Me.LOT_Number & "'"
DoCmd.Close acForm, "Landing_Page"
End Sub
Now I assume there is code behind RM_ADD_Form that deals with OpenArgs that would have to be changed or eliminated.
Or if you want to use OpenArgs (I have done this as well).
Code:
Private Sub Command45_Click()
Call Update_Lot_Button_Click
End Sub
Private Sub Update_Lot_Button_Click()
DoCmd.OpenForm "RM_ADD_Form", OpenArgs:=Me.Lot_Number
DoCmd.Close acForm, "Landing_Page"
End Sub
And code in RM_ADD_Form Load or Open event
Code:
If IsNull(Me.OpenArgs) Then
DoCmd.RunCommand acCmdRecordsGoToNew
Else
Me.Filter = "Lot_Number='" & Me.OpenArgs & "'"
Me.FilterOn = True
End If
Either allows user to abandon new record input without creating a new record with empty string.
In my db, Landing_Page (MainMenu in my db) never closes. It is sized so other forms cover it. I use Overlapping Windows instead of Tabbed Documents setting.