Format text box for date input dd/mm/yy or dd/mm

madhouse

Registered User.
Local time
Today, 01:21
Joined
Jul 3, 2002
Messages
65
I've got a Transaction Date field which at them moment has an Input Mask 00/00/0000;0;* so that users can only enter a date like 15/07/2004. However, my manager is being picky and also wants users to be able to enter a date such as 15/07, but to still have the date saved in the table as 15/07/2004. What's the easiest way of doing this? Am I best to take off the Input Mask and then let users enter what they like but then have some validation behind my Save Record button to ensure the date entered is either dd/mm/yyyy or dd/mm?
 
I never use an input mask for dates. I find them more annoying than anything. As long as your fields are properly defined in the table as dates, Jet won't let you save a bad value. The input mask won't stop you from entering 99/99/9999 so what's the point? I would get rid of it. Access will then default the year to the current year if you type in only 2 parts. It may also default the day to 1, if you enter something like - 2/2004. Mind you, I am in the US and using US date settings. Hopefully, it still works properly when your settings are something else. Test carefully.
 

Users who are viewing this thread

Back
Top Bottom