Results 1 to 5 of 5

Thread: change language

  1. #1
    Join Date
    Nov 2006
    Posts
    3

    Question Unanswered: change language

    --------------------------------------------------------------------------------

    Hi all,

    I have a problem concerning language. I am building a tool that is going to be used in different countries. The language of the tool is English.

    However when I use the long date format it uses the language specified in windows (like I get the dutch names of the weekday and month). I want it to always be in English, no matter what windows regional setting is. Anyone have a clue on how to do this?

    Thanks in advance!
    Frans-Jan

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if its just dates, or other values then consider rolling your own functions in place of the built in ones.

    Im assuming htat you are unable to change the localisation of the PC
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2006
    Posts
    3
    Hi there,

    Actually it so far only concerns a date format on some reports. I want to use the long format which on my computer looks like "Dinsdag, 28 november 2006" (because of the local settings) to always be in english spelling. Tuesday 28 November 2006. This regardsless of the local setting be set on Dutch, English, French, German or whatever other language.

    Changing local settings is no option since I am not in control over the end users' computers...

    If you can help I would really appreciate it. I've searched quite some forums and websites but so far found nothing in return. I did find sth about "set language" but can't get it to work and I am not even sure if it is sth for Access....

    Best regards,
    Frans-Jan

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Consider creating a function similar to this


    Code:
    Public Function FormatDate(DateValue As Date) As String
    Dim txtMonth As String
    Select Case Weekday(DateValue)  ' decode the day
    Case 1: FormatDate = "Sunday"
    Case 2: FormatDate = "Monday"
    Case 3: FormatDate = "Tuesday"
    Case 4: FormatDate = "Wednesday"
    Case 5: FormatDate = "Thursday"
    Case 6: FormatDate = "Friday"
    Case 7: FormatDate = "Saturday"
    End Select
    Select Case Month(DateValue)   'decode the month
    Case 1: txtMonth = " January "
    Case 2: txtMonth = " February "
    Case 3: txtMonth = " March "
    Case 4: txtMonth = " April "
    Case 5: txtMonth = " May "
    Case 6: txtMonth = " June "
    Case 7: txtMonth = " July "
    Case 8: txtMonth = " August "
    Case 9: txtMonth = " September "
    Case 10: txtMonth = " October "
    Case 11: txtMonth = " November "
    Case 12: txtMonth = " December "
    End Select
    'build the final string
    FormatDate = FormatDate & ", " & Format(Day(DateValue), "00") & " " & txtMonth & " " & Format(Year(DateValue), "0000")
    End Function
    place it in a code module and call it from whatever or wherever you want to (eg queries, reports, forms)

    you need to ensure that the function is supplied with a date value
    this function has no error checking, it always assumes you supply a date value
    you may also need to consider what to use as a default value if the date is invalid
    you could consider extending it to change the format as required (eg use a short month Jan, Feb, Mar etc.....), or a two digit year, or a short day (Sun,Mon etc...) if say you needed different versions, say where space was at a premium.

    If Access doesn't provide the functions you need there i sno reason why you can't write your own functions to be used in place or to extend Access.
    A brief word of caution though, user written fucntions can run very slowly (especially if you use domain aggregate fucntions), they don't work on server pass through queries, so whilst they are a powerfull tool, you do still need to consider if they are appropriate

    HTH
    Last edited by healdem; 11-28-06 at 09:36.
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Nov 2006
    Posts
    3
    Hi Healdem,

    That looks like sth I could also use indeed. I might have been staring myself blind on wanting to change the settings.

    Anyhow, I think I understand how the code works. I will try and test it later today, maybe tomorrowmorning. I'll let you know if it did the trick, ok!

    Thanks again and best regards,
    Frans-Jan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •