troubleshooting Question

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

Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia asked on
Microsoft Access
3 Comments3 Solutions12 ViewsLast Modified:
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
 
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros