I am using access 2007 and I am trying to get the code below to verify if 2 fields on the form are blank before closing. I tried using this in the close event and unload event and it does not work, just closes regardless of the fields.
If [field1] = "" and [field2] = "" then
Msgbox " You must enter a value in either field 1 or field 2"
Cancel = false
Else
Cancel = true
End If
Thanks for any assistance!
If [field1] = "" and [field2] = "" then
Msgbox " You must enter a value in either field 1 or field 2"
Cancel = false
Else
Cancel = true
End If
Thanks for any assistance!