Validating dates according to Regional Settings

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
 
J

John Viescas

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
 
T

TC

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
 

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