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 "phone"
Beep
MsgBox "The phone number you entered is invalid!"
Case "SSN"
Beep
MsgBox "The SSN you entered is invalid!"
Case "Zip"
Beep
MsgBox "The ZIP code you entered is invalid!"
Case Else
Beep
Msg = "An input mask violation occurred in control "
MsgBox Msg & Screen.ActiveControl.Name & "!"
End Select
Response = acDataErrContinue
End If