URGENT:  Date formatting function on PC with regional setting set to French (Canada)

Posted on 2005-05-03
Last Modified: 2006-11-18
Hi All,

First off, sorry about the point value, but it's all I have.

I have a database system with forms, installed on various user PC's. Most PC's regional settings are set to US (English) but I have a couple that are set to French (Canada).

The problem is in a part where I have a user enter a date in text form into a textbox in the format "mm-dd-yy".

When I type in "01-01-05" and format it as a date on the US ENglish boxes, the date is formatted fine, but on the french PC's, it becomes "01/05/2001".

Obviously, not good. I've been trying variations of date formatting functions on it, but to no avail.

Anyone know of a way to force the locale to US through code, or any other solution.

I'll increase the points to 200 if someone doesn't mind this being open for a while as I redeem more points.

Thx all...
Question by:knuckle05
    LVL 1

    Author Comment

    Nevermind....solved it.

    When having problems with differing Short Date formats, always convert your dates into a format where the month name is spelled out.

    Format$(CDate(strDay2 & " " & MonthName(strMth2, False) & " " & strYr2), JetDateFmt)

    Note: JetDateFmt is a custom format pattern that I made, not an intrinsic constant

    Accepted Solution

    Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
    With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now