Value you entered isn't valid for this field

Has anyone ever found a way to trap this error message and provide the user with a different message and even undo the field entry?  So far, I have not found any solutions.  The error happens before the LostFocus, Exit, BeforeUpdate events of the control.
I tried creating a function that would run in the OnValidate.  It seemed to work to a point, but was unreliable.  
To see what I'm talking about in action and to provide a working solution in a sample form I have uploaded a small database.
Open Form1. Enter 130pm in the MyDate field and you will get the error I'm referring to.
Mel BrooksCITOAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Place this code to your form's module:
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Dim ErrNo As Integer
ErrNo = 2113
    If (DataErr = ErrNo) Then
        Response = acDataErrContinue
        MsgBox "Please, correct date value", vbOKOnly
    End If
End Sub

Open in new window

Add Me.MyDate.Undo after message if you want to cancel changes in this field, but I prefer allow user to edit entered value

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeffrey CoachmanMIS LiasonCommented:
The problem with "Dates" is that you forever have to workaround all the different ways a user might enter an incorrect date
So if 130pm is wrong, ...then they try: 1:30pm, or1.30, ...or 130p or 130ppm
Or something like this for full dates
1/17 (Biggest issue because of the Y2k issue, this 2017 or 1917?)

For me, ...I tend to follow what most websites use for dates, avoid most of these date issues:
*Ask for the date in separate (Month, Day and Year) textboxes.*
for example
Seperate textboxes for date validation
Else, will forever be creating systems to check and workaround invalid dates.
This was the reason for the creation of the Date picker in Access, (though not perfect), it is designed to let a user only select valid dates)
If users can type in 130pm, ...for a date, can expect an almost endless array of other invalid date formats

(even Input masks sometimes create more problems than they are worth)

I attached a basic modified sample db

Gustav BrockCIOCommented:
10 Tips to Protect Your Business from Ransomware

Did you know that ransomware is the most widespread, destructive malware in the world today? It accounts for 39% of all security breaches, with ransomware gangsters projected to make $11.5B in profits from online extortion by 2019.

Mel BrooksCITOAuthor Commented:
I had tried using the OnError event previously, but couldn't get it to work consistently.  I didn't trap the specific error 2113 though like you did.  This looks like it will work very well especially when including a date range in the OnValidate event to prevent users from entering just a valid time value that the OnError event would not catch.
You can find list of errors here:
Error 2113 - The value you entered isn't valid for this field.
Jeffrey CoachmanMIS LiasonCommented:
Gustav Brock,
Great Article...

You know, ...every-time I get a chance, ...I try to lead my users into using the ISO date standard for dates and time...

Make everything a lot simpler...

Gustav BrockCIOCommented:
Indeed, but in many cases wishful thinking - like to turn the US from imperial to metric measures.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.