Ok I have a form that I will use to add Serial Numbers to a table called "ProdSerNmbrs". The form is called "sbfrmProdSerNmbrs" I have two fields
I need to check and see if either IsNull. This all happens OnClick of a Close button. If one or either IsNull I need it to Pop up a MsgBox VbYesNo. If the User Picks No Then go back to the form. If the user picks yes then Me.Undo and then close the form.
I can't figure this out because I have to many Else's. Here is just something I have been working with but can't get it to come out right. It may be even more messed up after trying over and over. thanks for the help.
On Error GoTo Command13_Click_Err
'Call the macro to check for empty records
If IsNull(Me.SerialNumber) = True Then
If Me.Dirty = True Then
msgbox "Not All Fields Were Completely Filled Out! Do you want to Still Exit Without Saving?", vbYesNo
If vbNo Then
If Me.Dirty = False Then
DoCmd.Close ObjectType:=acForm, ObjectName:=Me.Name, Save:=acSavePrompt