Date Format Code

S

Spag

Hello

In a form I am asking for the date to be entered in the following format
MMM-YY when moving to another cell the date format display returns to
DD-MMM-YY.

How do I make the cell remain as MMM-YY?

The format option in properties does not show the custom input mask format I
assigned to the table.

Any ideas would be greatly appreciated.

Thanks
 
T

Tom van Stiphout

On Tue, 2 Dec 2008 01:00:01 -0800, Spag

In the control's Format property, put:
MMM-YY

-Tom.
Microsoft Access MVP
 
J

John Spencer

Normally, I would expect that you use the INPUT MASK property to control input
and the FORMAT property to control the display of the value when the control
does not have the focus.

Just enter mmm-yy into the format property of the control. I assume you know
that if the field is a datetime field the value will be stored as a date and
will have a day, month, and year component. Normally, the date will be stored
as the first day of the month if you enter Jan 2007. But if you enter Jan 07
the date will be stored as January 7, 2008 (or whatever the current year is).
So you really need to input "mmm-yyyy" to get a reliable result. You won't
have a problem if the year is greater than the number of days in the month -
then you can get away with Jan 32 (as long as you want dates in the 20th
century (1930 to 1999)

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
S

Spag

Thank you very much for your responses. I didn't release having date and
time format always returned a date and time value. Anyway as you can guess it
is now working effectively.

It is now working fine
 

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