John C
John C

Reputation: 85

How to set date/time format during edit

I set the date/time format and Input Mask in a field to display/input a 24 hour format Dec-28-2006 @ 12:12 but when I edit the field with an existing date it reverts back to Dec/28/2006 12:12:00 PM.

Format is set to "mmm-dd-yyyy @ hh:nn
Input Mask is set to ">L

I need to keep the field in this mode (Dec-28-2006 @ 12:12) when editing an existing date/time. Is this possible?

Upvotes: 1

Views: 177

Answers (1)

Gustav
Gustav

Reputation: 55841

That is by design, and it takes a lot to make it behave differently.

You may get some inspiration from my two articles and their demo applications:

Entering ISO formatted date with input mask and full validation in Microsoft Access

Entering 24-hour time with input mask and full validation in Microsoft Access

If you don't have an account, browse for the link: Read the full article.

Too much code to post here, but code is also on GitHub: VBA.DateEntry and VBA.TimeEntry.

Upvotes: 1

Related Questions