date input format problem

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

Guest

For one of my databases I need the native date format to be mm/dd/yy i.e
US_English.
I'm running Access 2000 under Windows 2000
Regional Setting is UK/English
I've tried using the SetThreadLocale to 1033 (was 2057) but the date format
still appears to be coming from the UK_English system Default.
I don't want to set the default to US_English because of other databases etc
on the same machine
My format string is mm/dd/yy so the displays correctly, but entering
10/09/05 displays 09/10/05, showing that the locale is still UK_English
Anyone any ideas please.
 
Access gets its date format from Regional Settings.

For what it's worth, though, this shouldn't cause you any problems. Dates
are not stored with a format: they're 8 byte floating point numbers (where
the integer portion represents the date as the number of days relative to 30
Dec, 1899, and the decimal portion represents the time as a fraction of a
day)

You can change how the date is displayed by using the Format property of the
field or control, or by using the Format function in your queries.

You might find it useful to read Allen Browne's "International Dates in
Access" at http://allenbrowne.com/ser-36.html
or what I had in my September 2003 "Access Answers" column for Pinnacle
Publication's "Smart Access" newsletter. (The column and accompanying
database can be downloaded for free at
http://www.accessmvp.com/djsteele/SmartAccess.html)
 
This database is used on machine mainly for used for UK/european work so
changing the regional settings does not make sense. Just for this
application, it makes sense to input dates in Us format as that is what the
operator reads from the paperwork.
When I used the SetThreadLocale, even the control knows that it has been
changed, (msoLanguageIDUI = 1033) but the date input format still remains uk.
The format string is purely a display function, not an input function.
It looks like the SetThreadLocale doesn't include the date format bits of
the locale.
 
TonyP said:
This database is used on machine mainly for used for UK/european work so
changing the regional settings does not make sense. Just for this
application, it makes sense to input dates in Us format as that is what the
operator reads from the paperwork.

Then you can set the date format in the format property of the control
as dd/mm/yy. It's not in the drop down list so it's not obvious. Not
recommended to override the operators preferences in most situations
but in your case that makes sense.

You may want to leave the machine preference on other forms and
reports though.

(And for that matter you might want to give the user a button and with
a bit of VBA code toggle between "Short Date" and "dd/mm/yy" to suit
their preference.)

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
 

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

Back
Top