I have a subform with a date field on it. For that field, I have set a validation rule. When you enter a date that violates the rule, my custom text comes up just fine.
Then I get a message that says "The value in the field or record violates the validation rule for the record of field."
I searched the forum and found some previous comments on how to trap this error, (presumably Err #3022). I added standard error trapping code on the after update property of the date field, but I can't seem to get the code to work. I still get the info box.
Here is the code I tried:
Private Sub Date_AfterUpdate()
On Error GoTo Err_Date_AfterUpdate
Exit_Date_AfterUpdate:
Exit Sub
Err_Date_AfterUpdate:
If Err = 3022 Then
Exit Sub
Else
MsgBox Err.Description
Resume Exit_Date_AfterUpdate
End If
End Sub
Any suggestions?
Then I get a message that says "The value in the field or record violates the validation rule for the record of field."
I searched the forum and found some previous comments on how to trap this error, (presumably Err #3022). I added standard error trapping code on the after update property of the date field, but I can't seem to get the code to work. I still get the info box.
Here is the code I tried:
Private Sub Date_AfterUpdate()
On Error GoTo Err_Date_AfterUpdate
Exit_Date_AfterUpdate:
Exit Sub
Err_Date_AfterUpdate:
If Err = 3022 Then
Exit Sub
Else
MsgBox Err.Description
Resume Exit_Date_AfterUpdate
End If
End Sub
Any suggestions?