language date formatting

E

eaz

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?
 
J

John Spencer

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
..
 
E

eaz

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.
 

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