MSAccess Change Date Value Before Validation

Posted by sisdog on Stack Overflow See other posts from Stack Overflow or by sisdog
Published on 2014-06-11T15:51:19Z Indexed on 2014/06/13 9:26 UTC
Read the original article Hit count: 202

Filed under:

In a grid I have a date/time field where I would like the user to be able to type in short-hand formats for dates and times. For example, if they type in "435p" and then focus off of the cell they get the message "The value you entered isn't valid for this field.". Instead, I want to trap a pre-validationevent and change it to "4:35pm" for them.

What event can I use?

I've tried:

  1. LostFocus & BeforeUpdate: too late (validation fires before event)

  2. Dirty & OnChange: too early (they haven't left the cell yet)

Or is there a way to turn off the native validation rule that is checking for date formats?

© Stack Overflow or respective owner

Related posts about ms-access