Link to home
Start Free TrialLog in
Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia

asked on

How to suppress a default Ms Access error message on a form

I have been observing for quite some time now , users may enter some wrong data on a form un intentionally and get a very frightening message like below. Now I think its time to act on it any idea there?

I want to suppress those MS Access massages with user friendly messages like below:
Private Sub txtDatesTesting_BeforeUpdate(Cancel As Integer)
On Error GoTo Err_Handler
If (Me.txtDatesTesting <> Date) Then
Beep
MsgBox " Please note that what you have entered is not a valid correct dates", vbExclamation, " Wrong Data Capturing"
Cancel = True
Exit Sub
End If
Exit_txtDatesTesting_BeforeUpdate :
Exit Sub
Err_Handler:
MsgBox Err.Number & Err.Description, vbExclamation, "Error"
Resume Exit_txtDatesTesting_BeforeUpdate 
End Sub

Open in new window

User generated image 
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial