Date entry for current year

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.
 
J

Jeff Boyce

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.
 
J

John W. Vinson

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.
 

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