A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Date entry for current year



 
 
Thread Tools Display Modes
  #1  
Old January 11th, 2010, 07:10 PM posted to microsoft.public.access.forms
Anne
external usenet poster
 
Posts: 445
Default Date entry for current year

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.
  #2  
Old January 11th, 2010, 07:55 PM posted to microsoft.public.access.forms
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Date entry for 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.

"Anne" wrote in message
...
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.



  #3  
Old January 11th, 2010, 09:09 PM posted to microsoft.public.access.forms
Anne
external usenet poster
 
Posts: 445
Default Date entry for current year

Yes that works.
Anyway one can do it without the slash, like 0111?

"Jeff Boyce" wrote:

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.

"Anne" wrote in message
...
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.



.

  #4  
Old January 11th, 2010, 09:35 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Date entry for current year

On Mon, 11 Jan 2010 13:09:01 -0800, Anne
wrote:

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

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.