Hi,
I want to use a month field in the form of MMM YY e.g. Jul 07. Do I have to
create some form of input mask and format in order to do this or create two
different fields.
Thanks
Andy
A Date/Time field, no matter how it's displayed, is actually stored as a
double float number, a count of days and fractions of a day (times) since
midnight, December 30, 1899. As such it corresponds to an exact point of time.
Jul 07 (meaning July 2007) is *not* an exact point in time!
What's happening is that if you enter Jul 07 in the textbox, Access is
assuming you mean the 7th of July and entering the current year by default.
The Format indicates that you want to SEE the two-digit year, but that has
absolutely no effect on how Access reads what you type. A month name and two
digits *will* be interpreted as a month and day. I was curious enough to try
entering "Jul 99" into a textbox - it stores July 1, 1999, evidently since 99
makes sense as a year but not as a day.
If you want to force storage of a year, you'll need a four digit year. And if
you don't care about the day, I'd really suggest using two number fields for
the year (four digit year!!!!) and the numeric month, just so you can sort
chronologically. You could use combo boxes for data entry, e.g. a row source
of
1;"Jan";2;"Feb";3;"Mar" <etc>
with a column count of 2 and a bound column of 1 to enter the month, and just
a list of valid years.
John W. Vinson [MVP]