I have a problem errors handling
I use this trigger code for handling an error (2279)
but I can not handle more than one error using this code
I tried this syntax within the below mentioned code
Expand|Select|Wrap|Line Numbers
- Const INPUTMASK_VIOLATION = 2279 & 2113
Expand|Select|Wrap|Line Numbers
- Private Sub Form_Error(DataErr As Integer, Response As Integer)
- Const INPUTMASK_VIOLATION = 2279
- Dim Msg As String
- If DataErr = INPUTMASK_VIOLATION Then
- Select Case Screen.ActiveControl.Name
- Case "homePhone"
- Beep
- MsgBox "The phone you entered is invalid!", vbCritical
- Me.HomePhone.Undo
- Case "BirthDate"
- Beep
- MsgBox "The birth date you entered is invalid!", vbCritical
- Me.BirthDate.Undo
- Case Else
- Beep
- Msg = "an error"
- MsgBox Msg & Screen.ActiveControl.Name & "!"
- Me.Undo
- End Select
- Response = acDataErrContinue
- End If
- End Sub
I appreciate any suggestion
thank you very much