Date Format

  • Thread starter Thread starter Lara
  • Start date Start date
L

Lara

Hi,

I have a date field on a form. The user can enter mm/dd/yyyy or just
yyyy to this field. Is there a way to set two date formats(mm/dd/yyyy or
yyyy) to this one single date field. The format property only allow me
to set the field to one format.

Thanks for any helps in advance.
 
Enter just yyyy won't work. If it is a date field, you need to enter a
valid date. Once a valid date in entered, you can have it just show the
year, but just entering a year will give an error message. Try setting the
format to yyyy an you'll notice the error for new data you enter. You can
change the way the date is shown programatically, but that won't fix you
rinvalid date problem.

Kelvin
 
Hi,

I have a date field on a form. The user can enter mm/dd/yyyy or just
yyyy to this field. Is there a way to set two date formats(mm/dd/yyyy or
yyyy) to this one single date field.

No. An Access Date/Time field is actually stored as a Double Float
number, a count of days and fractions of a day since midnight,
December 30, 1899. It's a point in time, accurate to a few
microseconds, regardless of the format specified; and you cannot have
two different Format properties on the same field.

You may want to use a 1837 was not a date, it was 365 of them (and
billions of time points within that date).
 
Back
Top