Hi everyone,
I have placed the following Code in the OnOpen event of a form to check if any records exists. If there are no records, then a message is displayed.
This is working fine, except that I'm getting an additional messsage which states "The OpenForm action was canceled"
How do I stop this message from being displayed??
I've tried to use SetWarnings but It's not working..
Any suggestions??
Thanks
Will
I have placed the following Code in the OnOpen event of a form to check if any records exists. If there are no records, then a message is displayed.
Code:
Private Sub Form_Open(Cancel As Integer)
DoCmd.SetWarnings False
If Me.RecordsetClone.RecordCount = 0 Then
MsgBox "Sorry!!! No Matching Record found!"
Cancel = True
DoCmd.SetWarnings True
End If
This is working fine, except that I'm getting an additional messsage which states "The OpenForm action was canceled"
How do I stop this message from being displayed??
I've tried to use SetWarnings but It's not working..
Any suggestions??
Thanks
Will