Hi All,
For some reason the following code is not trapped when I get the error message (3201) 'The field 'whatever' cannot contain a Null vaue because the Required property for this field is set to True. Enter a value in this field.'
This is my code and it actually works fine in a different form but here it does not. I added a message box to show me the err. number before going to the code below and the response I got was '0'. Not sure why. Does anyone see a problem.
Thanks
If DataErr = 3201 Then
If vbYes = MsgBox("You cannot exit the form yet. You must complete the form or cancel out of it." _
& vbNewLine & "Do you want to cancel and delete the record you are currently adding?", _
vbYesNo + vbQuestion, "Delete Record") Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Response = acDataErrContinue
Else
Response = acDataErrContinue
End If
End If
For some reason the following code is not trapped when I get the error message (3201) 'The field 'whatever' cannot contain a Null vaue because the Required property for this field is set to True. Enter a value in this field.'
This is my code and it actually works fine in a different form but here it does not. I added a message box to show me the err. number before going to the code below and the response I got was '0'. Not sure why. Does anyone see a problem.
Thanks
If DataErr = 3201 Then
If vbYes = MsgBox("You cannot exit the form yet. You must complete the form or cancel out of it." _
& vbNewLine & "Do you want to cancel and delete the record you are currently adding?", _
vbYesNo + vbQuestion, "Delete Record") Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
Response = acDataErrContinue
Else
Response = acDataErrContinue
End If
End If