Hi There,
I hope someone can help with the following problem....
I have the following code attached to the open event of a form:
Private Sub Form_Open (Cancel As Integer)
If Me!txtWasteProd = 0 Then
MsgBox "The answer is 0."
Cancel = True
Else
End If
End Sub
This works fine and does pretty much what I'd like it to, i.e. if the value in txtWasteProd is '0' then a Message box displaying the above message appears and the form does not open.
However, after my message box appears another one appears that says the following: " The OpenForm action was cancelled." I think this box might confuse users. Is there anyway to prevent access from displaying this message????
Thanks for any help.
Becca
I hope someone can help with the following problem....
I have the following code attached to the open event of a form:
Private Sub Form_Open (Cancel As Integer)
If Me!txtWasteProd = 0 Then
MsgBox "The answer is 0."
Cancel = True
Else
End If
End Sub
This works fine and does pretty much what I'd like it to, i.e. if the value in txtWasteProd is '0' then a Message box displaying the above message appears and the form does not open.
However, after my message box appears another one appears that says the following: " The OpenForm action was cancelled." I think this box might confuse users. Is there anyway to prevent access from displaying this message????
Thanks for any help.
Becca