Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to show date in 2 languages?

Status
Not open for further replies.

klaas01

MIS
Feb 5, 2005
16
NL
Hello,

I've got an access application which contains a report with the field birth date.

The standard language is dutch, so the month of the birthdate is shown in dutch.

the report is also translated to a english version, the problem is that the month of the birthdate is shown in dutch, like juni instead of june.

Does anybody knows if it's possible to switch in some cases like this to another language?

thanks.
 
If you are getting the date from a format (dd mmmm, say) then the language will be controlled by Windows Regional & Language settings on the control panel.
 
That's right, but is there a way to get another language than the system language, when using the format(date()) function?
 
If you want to show both without changing your regional settings then roll your own functions i.e.
Code:
Public Function formatDateEnglish(dtmDate As Date) As String
  Dim strMonth As String
  Select Case Month(dtmDate)
  Case 1
    strMonth = "Jan"
  Case 2
    strMonth = "Feb"
  '...
  Case 8
    strMonth = "Aug"
  Case 12
    strMonth = "Dec"
  End Select
  
  formatDateEnglish = Format(dtmDate, "DD") & strMonth & Format(dtmDate, "YYYY")
End Function

Public Function formatDateSpanish(dtmDate As Date) As String
  Dim strMonth As String
  Select Case Month(dtmDate)
  Case 1
    strMonth = "Enero"
  Case 2
    strMonth = "Feb"
  '...
  Case 8
    strMonth = "Agosto"
  Case 12
    strMonth = "Dic"
  End Select
  
  formatDateSpanish = Format(dtmDate, "DD") & strMonth & Format(dtmDate, "YYYY")
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top