Although I have used the code below to suppress the DoCmd cancel
action message from appearing on lots of other actions such as preview
and print, I have not been able to get to work on a BeforeUpdate Event
Procedure. There is nothing elaborate about the event, however, there
is an initial message box stating that if one field contains data then
a second one must also, and then after clicking okay, the
DoCmdMenuItem action box is displayed.
Any suggestions on addressing this problem will be appreciated.
Thanks.
Private Sub Form_BeforeUpdate (Cancel As Integer)
Exit_Form_BeforeUpdate:
Exit Sub
Err_Form_BeforeUpdate:
Const conErrDoCmdCancelled = 2501
If (err = conErrDoCmdCancelled) Then
Resume Exit_Form_BeforeUpdate
Else
MsgBox err.description
Resume Exit_Form_BeforeUpdate
End If
End Sub