Display label reading from the table

  • Thread starter Thread starter ILIRI
  • Start date Start date
I

ILIRI

Hello
I have seen this before and I didn't pay a lot of attention, and you know
the feeling when you need a tool that you have been kicking it around, you
can't find it.

So this what I want to achieve:
- Every time access database starts up I need a form to select language 1)
English; 2) French 3)German .....
Once the user has selected the language by clicking on the Option Button
beside the language and then OK button the switchboard would load in to the
screen with the rest of the forms and reports in that particular language
(with this I mean all the labels of forms and rep's and not the content of
the record).

I reckon this is achieved by creating a lang_table with following items:

ID, English, French, German ...
1 Name Nom, Name ...
2 Last Name Prénom, Nachname, ...
3 Address Adresse Adresse ...
.... ... ... ...

and the data_table would have field names something like: ID, a1, a2, a3,
a4....

Here I would need a function to change the display of a1: Joe to Name: Joe
or if French was selected, Nom: Joe.

Thanks.




__________ Information from ESET NOD32 Antivirus, version of virus signature database 4075 (20090514) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
No need for a table. Just use the openargs method to open the form with the
desired language..
The click event of the OK button:
Dim x As Integer
x = Me.Frame0.Value 'your optionframe value - 1 =English, 2=French, 3=
German, 4= Spanish....
DoCmd.OpenForm "Your form name", acNormal, , , , , x

Then in the load event of your switchboard form,

Private Sub Form_Load()
Select Case Me.OpenArgs
Case 1 'English
Me.Label1.Caption = "Name"
Me.Label2.Caption = "whatever"
etc.
Case 2 'French
Me.Label1.Caption = "Nom"
Me.Label2.Caption = "whatever"
Case 3
etc.....
Case 4
etc.....
End Select
End Sub


HTH
Damon
 
Hello
I have seen this before and I didn't pay a lot of attention, and
you know the feeling when you need a tool that you have been
kicking it around, you can't find it.

So this what I want to achieve:
- Every time access database starts up I need a form to select
language 1) English; 2) French 3)German .....
Once the user has selected the language by clicking on the Option
Button beside the language and then OK button the switchboard
would load in to the screen with the rest of the forms and reports
in that particular language (with this I mean all the labels of
forms and rep's and not the content of the record).

I reckon this is achieved by creating a lang_table with following
items:

ID, English, French, German ...
1 Name Nom, Name ...
2 Last Name Prénom, Nachname, ...
3 Address Adresse Adresse ...
... ... ... ...

and the data_table would have field names something like: ID, a1,
a2, a3, a4....

Here I would need a function to change the display of a1: Joe to
Name: Joe or if French was selected, Nom: Joe.

Thanks.
You want the following structure, not the one you propose

LanguageId, LabelId, LabelText
1 1 Name
2 1 Nom
3 1 Name ...
1 2 First Name
2 2 Prénom
3 2 Nachname
1 3 Address
2 3 Adresse
3 3 Adresse
....

Then you need some code in form_load to read through that table and
change the labels to the appropriate language.
 
There are a couple of ways to do it. The real easy way is to use a macro
namened Autoexec with action to open your switch board. On the first page of
the switchboard have choices of the three language. Selecting an language
moves the switchboard to another page that has that language.

The harder way is as you suggest. Use a macro namened Autoexec with action
to open your selection form with an Option Group. Use the On Change event of
the Option Group to call macro named Language. The macro has three actions
to open switchboard forms with condition based on the value from the Language
form Option Group. --- [Forms]![Language]![FrameOfOption_Group]
 
Back
Top