If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
language date formatting
My PC is regional setting is dutch
I have to print documents with date format dd-mmm-yyyy Problem is, that mmm should always be English (not dutch). How to enforce that? |
#2
|
|||
|
|||
language date formatting
The only way I can think of is to write a custom VBA function to return the
month abbreviation. UNTESTED sample function with no error handling follows Public Function fEnglishDate (DateIn as Variant) Dim dateString as String If IsDate(DateIn) = False Then fEnglishDate = DateIn Else Select Case Month(DateIn) Case 1 : "Jan" Case 2: "Feb" ... Case 12: "Dec" End Select FEnglishDate = Format(Day(DateIn),"00") & "-" & dateString & "-" & Year(DateIn) End if End Function -- John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County .. "eaz" wrote in message ... My PC is regional setting is dutch I have to print documents with date format dd-mmm-yyyy Problem is, that mmm should always be English (not dutch). How to enforce that? |
#3
|
|||
|
|||
language date formatting
I temporarily solved it, by converting the month to a number (01,02,..) with
month function, and link that to a database table with 01 JAN, 02 FEB etc. This allows me to enter different languages later on. It is ugly, but at least it works. Thanks for the reply, and if you happen to see an elegant solution, let me know. "John Spencer" wrote: The only way I can think of is to write a custom VBA function to return the month abbreviation. UNTESTED sample function with no error handling follows Public Function fEnglishDate (DateIn as Variant) Dim dateString as String If IsDate(DateIn) = False Then fEnglishDate = DateIn Else Select Case Month(DateIn) Case 1 : "Jan" Case 2: "Feb" ... Case 12: "Dec" End Select FEnglishDate = Format(Day(DateIn),"00") & "-" & dateString & "-" & Year(DateIn) End if End Function -- John Spencer Access MVP 2002-2005, 2007 Center for Health Program Development and Management University of Maryland Baltimore County .. "eaz" wrote in message ... My PC is regional setting is dutch I have to print documents with date format dd-mmm-yyyy Problem is, that mmm should always be English (not dutch). How to enforce that? |
Thread Tools | |
Display Modes | |
|
|