Not showing system error message

G

Guest

I have a date field on a form and the user is to input using the mm/dd/yy
format. If the user uses a different format, the system error message
displays. How can I suppress that message and use my own message and
processing?
Thanks.
 
A

Allen Browne

Typically Access does NOT give a warning message if the user inputs the date
the wrong way around. I wish it would, but it just plays around with the
numbers and makes nonsense out of them, for example, if you enter:
2/29/05
it knows that 05 is not a leap year, so it decides you meant Feb 5 2009.

You do get an error message for some impossible dates, e.g.: 88/88/88. You
can use the Error event of the form to trap that message. DataErr will be
2113. Display your own message, and suppress the built-in message by setting
Response to acDataErrContinue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top