Translating a label into another language

I

Ixak

Hello
I have designed a section in a report to divide by months and the result is
august 2006 ..., june 2006
How could I change this in order to translate it to another languge?
I mean, sth like:

if month.text = "august 2006" then
month2.text= "agosto 2006"
else
if month...

Where should I write this code? I have started on the open form or load but
this label, month label doesn´t allow me or don´t give me the chance to
write . value or . text

Thanks for all
 
G

Guest

Ixak -

You can store the English & Spanish names in an array. Use a "language"
variable to pick the proper column to select.

Option Base 1 'Makes array 1-based versus 0-based
....
Dim aryMonth (12, 2) as string 'Dimension array.

'Load array elements.
aryMonth (1, 1) = "January"
aryMonth (1, 2) = "Enero"
....

'Select proper caption.
If LangSelected = "English" Then
Me.LangLabel.Caption = aryMonth (Month (myDate), 1)
Else
Me.LangLabel.Caption = aryMonth (Month (myDate), 2)
End If

Also, labels use the "Caption" property, not the "Text" or "Value" property,
to set the text displayed.

HTH,
Bruce
 
I

Ixak

I haven´t got the idea.
Imagine that one label is not visible, and I only want to take the
information which is suposed to be written there, and depending on that
write another output in another label.
if label.??? then
label2.??? = ...
end if
my problem is that the caption property doesn´t exit for these labels, or
at least I don´t get it.
thanks
 
G

Guest

Ixak,

If all you are doing is "copying" the caption of the label, then:
Label2.Caption = Label1.Caption

To test the caption in Label1 and change Label2:
If Label1.Caption = "xxx" Then Label2.Caption = "yyy"

Based upon what you said in the original post, I thought you were trying to
build English/Spanish text, based upon a date, to display in the label.
Sorry.

Hope this help,
Bruce
 
I

Ixak

Thanks for your help but I don´t get with the solution. I write this code on
the open report event but it doesn´t recognize the caption property.
 
G

Guest

Ixak,

1) I thought we were dealing with a Form, here. You talk about the
Report_Open event. If it's a report, you probably should have posted your
question to the Access Reports forum.

2) Any such logic should go in the section's (FormHeader, Detail,
PageFooter, etc.) Format event, not in the Open event.

3) In a report, you cannot assign a value to a text box. You can, however,
change the value of a Caption.

4) You can also use a function (either Public or within the report itself)
to assign a value to a textbox in a report by setting its datasource to the
function, e.g.
"=ShowMonthByLanguage(myMonth)"

To be more specific, I need to see your report code and have better
knowledge of exactly what you are trying to do.

Best,
Bruce
 

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