Language for month

S

sebross

I'm making a database to track a my activities in Access 2007.
For every activity I have fields for date, description and duration.

I have also set up a report, grouped by month.
The name of the month + the year is the heading for every group.

However, the name of the month is written in Norwegian. I would like this to
be in English. That is, "October" instead of "Oktober".

Is there any way I could do this?
 
A

Arvin Meyer [MVP]

A label can be translated to any language that the keyboard and your copy of
Windows supports. As to the data, itself, you'd need to translate that to
the way you want to display it. Also look at the regional settings in the
Control Panel, to see which languages are supported.
 
S

sebross

By changing the regional settings for Windows to English (USA), I achieved
what I wanted.

However, this changes the settings for the entire operating system. I would
only like the change to affect the specific database.

Can this be achieved somehow?
 
K

KARL DEWEY

If you are only concerned with translating the month then use a table
containing three fields ---- Month- integer, English- text, & Norwegian- text
In design view grid use the following fields, tables, and criteria --
Mon_Cal : DatePart("m", [YourDateField]) [English]
[YourDataTable] [TranslationTable]
[TranslationTable].[Month]

Do not join the tables.
 
A

Arvin Meyer [MVP]

I would build a table with the keyboard language + any languages that you
anticipate having to translate into. Write a function to lookup and display
the correct long date that you want to show. Or if you only have 1 language
to worry about, the function can simply use 12 cases to display it.

Public Function FrenchMonth(dtmIn As Date) As String
On Error Resume Next

Select Case Month(dtmIn)
Case 1
FrenchMonth = "Janvier"
Case 2
FrenchMonth = "Février"
Case 3
FrenchMonth = "Mars"
Case 4
FrenchMonth = "Avril"
Case 5
FrenchMonth = "Mai"
Case 6
FrenchMonth = "Juin"
Case 7
FrenchMonth = "Juillet"
Case 8
FrenchMonth = "Août"
Case 9
FrenchMonth = "Septembre"
Case 10
FrenchMonth = "Octobre"
Case 11
FrenchMonth = "Novembre"
Case 12
FrenchMonth = "Décembre"
End Select

FrenchMonth = Day(dtmIn) & " " & FrenchMonth & ", " & Year(dtmIn)

End Function

Then your dates should look like:

? FrenchMonth(Date)
13 Décembre, 2007
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
S

sebross

It is not just the months I am concerned with (although they are the most
important). I also have some dates (like the date printed on the bottom of
the sheet) I would like to have translated to American date format (October
7, 2007 instead of 7. oktober 2007).

Is this possible?

KARL DEWEY said:
If you are only concerned with translating the month then use a table
containing three fields ---- Month- integer, English- text, & Norwegian- text
In design view grid use the following fields, tables, and criteria --
Mon_Cal : DatePart("m", [YourDateField]) [English]
[YourDataTable] [TranslationTable]
[TranslationTable].[Month]

Do not join the tables.
--
KARL DEWEY
Build a little - Test a little


sebross said:
By changing the regional settings for Windows to English (USA), I achieved
what I wanted.

However, this changes the settings for the entire operating system. I would
only like the change to affect the specific database.

Can this be achieved somehow?
 
S

sebross

I am not really that experienced with Access.

Could you please explain to me how to set this up?

Norwegian | English
-----------------------------
Januar | January
Februar | February
Mars | March
April | April
Mai | May
Juni | June
Juli | July
August | August
September | September
Oktober | October
November | November
Desember | December
 
R

RoyVidar

sebross said:
I'm making a database to track a my activities in Access 2007.
For every activity I have fields for date, description and duration.

I have also set up a report, grouped by month.
The name of the month + the year is the heading for every group.

However, the name of the month is written in Norwegian. I would like this to
be in English. That is, "October" instead of "Oktober".

Is there any way I could do this?

I think it's picked from the regional settings. It might be doable with
lot of APIs, but I think I'd settle with rolling my own MonthName
function.

I did a short web-search, and the function at the bottom of the
following faq, seems to be able to do the trick.

http://www.tek-tips.com/faqs.cfm?fid=4342

(I think I'd call the function something else, though, say
MonthName_No or something, to not mix it up with the existing
function)
 
A

Arvin Meyer [MVP]

So, here's the code for NorwegianMonth, changed slightly to handle queries
with empty dates, which are converted to today:

Public Function NorwegianMonth(dtmIn As Variant) As String
On Error Resume Next

If Len(dtmIn & vbNullString) = 0 Then dtmIn = Date

Select Case Month(dtmIn)
Case 1
NorwegianMonth = "Januar"
Case 2
NorwegianMonth = "Februar"
Case 3
NorwegianMonth = "Mars"
Case 4
NorwegianMonth = "April"
Case 5
NorwegianMonth = "Mai"
Case 6
NorwegianMonth = "Juni"
Case 7
NorwegianMonth = "Juli"
Case 8
NorwegianMonth = "August"
Case 9
NorwegianMonth = "September"
Case 10
NorwegianMonth = "Oktober"
Case 11
NorwegianMonth = "November"
Case 12
NorwegianMonth = "Desember"
End Select

NorwegianMonth = Day(dtmIn) & " " & NorwegianMonth & ", " & Year(dtmIn)

End Function

Put the code in a standard module and save it with a name other than what is
set up. To display any date, feed the function a date from somewhere else.
For instance in a report, a textbox controlsource might look like:

= NorwegianMonth([MyDateField])

In a query, you'd use it like:

SELECT tblMyData.ID, NorwegianMonth([DateField]) AS NorwegianDate
FROM tblMyData;
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
A

Arvin Meyer [MVP]

An expression to show an American date is:

AmericanDate = Format([DateField], "mmmm d, yyyy")
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

sebross said:
It is not just the months I am concerned with (although they are the most
important). I also have some dates (like the date printed on the bottom of
the sheet) I would like to have translated to American date format
(October
7, 2007 instead of 7. oktober 2007).

Is this possible?

KARL DEWEY said:
If you are only concerned with translating the month then use a table
containing three fields ---- Month- integer, English- text, & Norwegian-
text
In design view grid use the following fields, tables, and criteria --
Mon_Cal : DatePart("m", [YourDateField]) [English]
[YourDataTable] [TranslationTable]
[TranslationTable].[Month]

Do not join the tables.
--
KARL DEWEY
Build a little - Test a little


sebross said:
By changing the regional settings for Windows to English (USA), I
achieved
what I wanted.

However, this changes the settings for the entire operating system. I
would
only like the change to affect the specific database.

Can this be achieved somehow?


:

A label can be translated to any language that the keyboard and your
copy of
Windows supports. As to the data, itself, you'd need to translate
that to
the way you want to display it. Also look at the regional settings in
the
Control Panel, to see which languages are supported.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

I'm making a database to track a my activities in Access 2007.
For every activity I have fields for date, description and
duration.

I have also set up a report, grouped by month.
The name of the month + the year is the heading for every group.

However, the name of the month is written in Norwegian. I would
like this
to
be in English. That is, "October" instead of "Oktober".

Is there any way I could do this?
 

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