A
Amit
Windows XP, MS Access 2K
=====================
Hi,
I have a button on my form to save the current new record. I also have code
in form's BeforeUpdate event to do data validation. When I intentionally
leave a required field blank and click on the Save button, the code in
BeforeUpdate gets executed, and the custom error message is displayed.
But, my custom error message is followed by another message that says
"DoMenuItem action was cancelled.". I'm not sure why this warning message is
being displayed, and how can I turn it off? I tried adding Docmd.setwarnings
(False) at the beginning of code in BeforeUpdate (and remembering to turn
them on when I exit), but the message is still being displayed.
Any ideas on how to handle this?
Here's the code snippet in BeforeUpdate:
=========================================
MsgBox "Inside Before Update"
DoCmd.SetWarnings (False)
If Len(Me.RequestTitle & "") = 0 Then
Cancel = True
MsgBox "Please enter a name or title for your request."
Me.RequestTitle.SetFocus
Exit Sub
ElseIf
......
End If
=========================================
Thanks!
-Amit
=====================
Hi,
I have a button on my form to save the current new record. I also have code
in form's BeforeUpdate event to do data validation. When I intentionally
leave a required field blank and click on the Save button, the code in
BeforeUpdate gets executed, and the custom error message is displayed.
But, my custom error message is followed by another message that says
"DoMenuItem action was cancelled.". I'm not sure why this warning message is
being displayed, and how can I turn it off? I tried adding Docmd.setwarnings
(False) at the beginning of code in BeforeUpdate (and remembering to turn
them on when I exit), but the message is still being displayed.
Any ideas on how to handle this?
Here's the code snippet in BeforeUpdate:
=========================================
MsgBox "Inside Before Update"
DoCmd.SetWarnings (False)
If Len(Me.RequestTitle & "") = 0 Then
Cancel = True
MsgBox "Please enter a name or title for your request."
Me.RequestTitle.SetFocus
Exit Sub
ElseIf
......
End If
=========================================
Thanks!
-Amit