I've the following validation code on a data entry form
Private Sub CboCommCode_Exit(Cancel As Integer)
If IsNull(Me.CboCommCode) Or Me.CboCommCode = "" Then
MsgBox "Community is required! Enter community or select from list!"
Me.Undo
Cancel = True
End If
End Sub
after the user fills in the required info and press the add button, i clear the form and set the focus back to Me.CboCommCode for the user to add the next community. the problem i'm facing is when the user wants to quit and click the close button, the above validation rule kick in and ask for a community since i clear it and the user will have to enter something in the Me.CboCommCode then click the close button to exit. How can I tell Access if a close button is click, ignore the validation rule? Your help/suggestion is greatly appreciated.
Thanks
Private Sub CboCommCode_Exit(Cancel As Integer)
If IsNull(Me.CboCommCode) Or Me.CboCommCode = "" Then
MsgBox "Community is required! Enter community or select from list!"
Me.Undo
Cancel = True
End If
End Sub
after the user fills in the required info and press the add button, i clear the form and set the focus back to Me.CboCommCode for the user to add the next community. the problem i'm facing is when the user wants to quit and click the close button, the above validation rule kick in and ask for a community since i clear it and the user will have to enter something in the Me.CboCommCode then click the close button to exit. How can I tell Access if a close button is click, ignore the validation rule? Your help/suggestion is greatly appreciated.
Thanks