Validating dates according to Regional Settings

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi,

If I move my Access DB to another computer with a different short date
value set in Windows regional settings, the validation rules are no
longer correct. E.G. if my validation rule is Like "##/##/##" but the
new computer uses a four figure year in the short date format the
validation rule would have to be Like "##/##/####"

Is there any way I can get Access to validate dates according to the
format set in regional settings?

Many thanks

Mark
 
Mark-

Why do you think you need this validation rule? If this is a true date/time
field, Access won't let the user enter something that isn't a valid
date/time value. If you want to be sure that they always enter only a date
value, use an input mask with a 4-digit year.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
http://www.deanforamerica.com/site/TR?pg=personal&fr_id=1090&px=1434411
 
A trick I use is to convert the string "1/2/2000" to a date, then check the
day & month components. By that means, you can tell how the date is being
formatted (d/m, m/d etc.) - without any API calls. Then you can construct an
appropriate format.

TC
 
Back
Top