I have a problem, I am making a form to enter dates. If I don't put in validation rules eventually the bad dates get into the database and to avoid that I am trying to create an error message that a user will understand. I have the code working for the default inputmask violation, but in the text of the error message I would like to have the name of the control that the error was made. I assume I have to make a string variable. This is what I have so far.. any help would be awesome. Thanks!
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Dim txtBox As String
Const INPUTMASK_VIOLATION = 2279
txtBox = Me.????
If DataErr = INPUTMASK_VIOLATION Then
MsgBox "<variable> needs to be in mm/dd/yyyy format"
Response = acDataErrContinue
End If
End Sub
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Dim txtBox As String
Const INPUTMASK_VIOLATION = 2279
txtBox = Me.????
If DataErr = INPUTMASK_VIOLATION Then
MsgBox "<variable> needs to be in mm/dd/yyyy format"
Response = acDataErrContinue
End If
End Sub