Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

removing error message 1

Status
Not open for further replies.

roamer762

MIS
Aug 16, 2002
26
0
0
MT
I have a form in which date has to be entered.I have set the input mask and the format to medium date.NOw if data entry is not in correct format and someone enters 32-mar-06 access generates a label with an error "The value entered is not valid for this field" .Is there any way where this error is not seen and instead a msgbox with whatever I want to write is generated ?


Cheers Sally
 
How about:
Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
'Keywords: Custom error input mask violation
'goes in a form module
    Const INPUTMASK_VIOLATION = 2279
    If DataErr = INPUTMASK_VIOLATION Then
       'MsgBox "There was an input mask violation!"
       Screen.ActiveControl.Undo
       Response = acDataErrContinue
    End If
 End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top