Date entry for current year

  • Thread starter Thread starter Anne
  • Start date Start date
A

Anne

I would like to be able to enter a date MMDD without having to enter a year,
with the year being presumed to be the current year.
 
Anne

If you have a table with a date/time-type field, and if you bind a form
control to that field, you can enter:

1/11

and hit enter or tab. Access assumes that any such entry in a date/time
field without a year showing must be in the current year.

Good luck!

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 
Yes that works.
Anyway one can do it without the slash, like 0111?

You can use an inputmask such as 00/00 to allow the user to just use four
keystrokes (0111); Access will fill in the slash for you.

Or you can use VBA code in the control's BeforeUpdate event to insert a slash.
 
Back
Top