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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set warnings is false for nothing 1

Status
Not open for further replies.

kennetha

Programmer
Sep 10, 2003
105
MT
Hi all,
I have a bound edit box with a date. I have set an input mask and used VBA to verify date validation (before update). I also used setwarnings to false but it seems not to work since after the my msgbox is displayed an Access warnings are displayed too. Note date (table) is set to required.
Can you help plz.
thx
Kenneth
 
If you want no error message to be displayed when the input mask is invalid, then you can use the Form_Error event to catch when an invalid input is made.

Code:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
    If Screen.ActiveControl.Name = "YourTextControl" Then
            Response = 0
            MsgBox "Your error message"
    End If
    
End Sub

If you dont want any error message displayed about the input mask error, remove the MsgBox statement, otherwise you can change the MsgBox to customise your own error message.

Regards,
John.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top