data entry - date format is mmddyyyy BUT if...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Why when you enter mmddyyyy as 31122005.....Access will automatically switch
the 31 to be the days and 12 to be the month. I expected an error message.

But if I enter 31312005 an error is displayed. How do I stop Access from
switching my entry around?

Thanks,
 
jube said:
Why when you enter mmddyyyy as 31122005.....Access will automatically
switch the 31 to be the days and 12 to be the month. I expected an
error message.

But if I enter 31312005 an error is displayed. How do I stop Access
from switching my entry around?

Thanks,

Access will assume the order is the same as your regional settings UNLESS
that results in an illegal value. There are only 12 months in the year so
if the first two digits are greater than 12 then they cannot represent a
month. Therefore Access assumes is must be the day since the next pair of
digits do comprise a legal month value. This bevavior cannot be turned off
as far as I know.

31312005 is not a legal date value no matter how you slice it thus you get
an error.
 
This won't actually stop Access from switching your entry around but it might
be get you where you want to be on your form.

Edit the control on the form you are using to use the format you want. Open
the properties of the control and click the "Format" tab. Under "Format"
choose the date format you want to use. I usually also go to the "Data" tab
and edit the "Input Mask" so that the user has to input the field properly.

Hope this helps,
Rob
 
Back
Top