Validation Rule Popup

  • Thread starter Thread starter jutlaux
  • Start date Start date
J

jutlaux

I have created a validation rule and also a validation text that are both
working correctly. The problem I have is that if the validation rule is
violated my message appears, but then I generic Microsoft Office Access error
appear saying that "The value in the field or record violates the validation
rule for the record or field".

Since I created my own message box that gives a little for info how can I
prevent the generic popup from appearing?

Thanks!
 
Hi jutlaux,
that error is coming from the form error event.
You can trap for the error there.

Private Sub Form_Error(DataErr As Integer, Response As Integer)

If DataErr = 2116 Then
Response = acDataErrContinue
Else
MsgBox DataErr & " " & Response
End If
End Sub

Note: it is probably dataerr no 2116, but could be 3316 or 3317


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
Back
Top