473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

multilingual Access 2002 application (best practices)

Hi all

I have to localize an Access 2002 application: The application using
several form, tables etc. is currently only in English. Now the
frontend has to be bilingual, so the user can choose if he wants the
form content in English or in French. I have never done something like
this before with Access. One way I think would be like that:

- creating a table tblLanguage with the following fields:
- FormName
- ControlName
- ControlType
- English
- French

- on the forms Open event, i would loop through all the items
collection and set the captions of all labels, comboboxes, buttons
etc. according to the appropriate language value in tblLanguage.

Is this the common way to do such a task? I've heard about the
'Multilingual User Interface Pack' for Office XP, but I think this is
only to change the language for the menues, windows messages etc.,
right? Or would I be able to create multilingual form with the
'Multilingual User Interface Pack'? I couldn't figure it out visiting
the microsoft website.

Any advice would highly be appreciated!

Thank you,

Juerg
Nov 12 '05 #1
7 4367
On 15 Oct 2003 09:52:17 -0700, de**@simsy.ch (J?rg Keller) wrote:
Any advice would highly be appreciated!


Hello, I've done this recently and it's working very nice.
I have set up a table 'tblVertaling' with two fields.
- Number
- Text
I've had reserved 1000 numbers for each language used (you could
reserve more if necessary, but 1000 is already much).
for instance 1-1000 = Dutch, 1001 to 2000 = English ...
The table has been filled in like this:
1 Annuleren
1001 Cancel
2001 cancel in other language
and so on

I've declared a public variable
Public lnglanguage As Long

You should set this variable for instance by opening your app. In my
example for dutch this would be 0, and for english this would be 1000.

In the onopen event of forms, reports (I've only used it for reports)
I put code like this:

************************************************** ***************
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is Label Then
If ctl.Tag <> "" And Not IsNull(ctl.Tag) Then
ctl.Caption = LoadString(ctl.Tag + lnglanguage) 'so eg 1 +
1000 is number 1001 out the table
End If
End If
Next ctl
************************************************** ***************
With the loadstring I call this procedure that resides in a module
pasted below.
Notice that I put the number of the translation required in the
tagfield of every object.
eg. a label that says 'Hello There!' (and has number 2 in the table
with translations) has in the tag the number (2) referencing the one
in the table with translations.

************************************************** ***************
Function LoadString(lngNumber As Long) As String
On Error GoTo HandleErrors
Dim strLoadString As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String

Set db = CurrentDb
strSQL = "SELECT tblvertaling.* FROM tblvertaling WHERE
tblVertaling.number = " & lngNumber & ";"
Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot)

With rst
If .RecordCount <> 0 Then
.MoveFirst
strLoadString = !Text
End If
End With

exithere:
On Error Resume Next
rst.Close
db.Close
Set rst = Nothing
Set db = Nothing
LoadString = strLoadString
Exit Function
HandleErrors:
MsgBox "basVertaling - LoadString:" & vbNewLine & Err.Number & " "
& Err.Description
Resume exithere
End Function
************************************************** ***************

Hopes this clear. One could always point me at bad code, or better
ways of handling this.
regards,
--
bebelino
Nov 12 '05 #2
On 15 Oct 2003 09:52:17 -0700, de**@simsy.ch (J?rg Keller) wrote:
Any advice would highly be appreciated!


Hello, I've done this recently and it's working very nice.
I have set up a table 'tblVertaling' with two fields.
- Number
- Text
I've had reserved 1000 numbers for each language used (you could
reserve more if necessary, but 1000 is already much).
for instance 1-1000 = Dutch, 1001 to 2000 = English ...
The table has been filled in like this:
1 Annuleren
1001 Cancel
2001 cancel in other language
and so on

I've declared a public variable
Public lnglanguage As Long

You should set this variable for instance by opening your app. In my
example for dutch this would be 0, and for english this would be 1000.

In the onopen event of forms, reports (I've only used it for reports)
I put code like this:

************************************************** ***************
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is Label Then
If ctl.Tag <> "" And Not IsNull(ctl.Tag) Then
ctl.Caption = LoadString(ctl.Tag + lnglanguage) 'so eg 1 +
1000 is number 1001 out the table
End If
End If
Next ctl
************************************************** ***************
With the loadstring I call this procedure that resides in a module
pasted below.
Notice that I put the number of the translation required in the
tagfield of every object.
eg. a label that says 'Hello There!' (and has number 2 in the table
with translations) has in the tag the number (2) referencing the one
in the table with translations.

************************************************** ***************
Function LoadString(lngNumber As Long) As String
On Error GoTo HandleErrors
Dim strLoadString As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strSQL As String

Set db = CurrentDb
strSQL = "SELECT tblvertaling.* FROM tblvertaling WHERE
tblVertaling.number = " & lngNumber & ";"
Set rst = db.OpenRecordset(strSQL, dbOpenSnapshot)

With rst
If .RecordCount <> 0 Then
.MoveFirst
strLoadString = !Text
End If
End With

exithere:
On Error Resume Next
rst.Close
db.Close
Set rst = Nothing
Set db = Nothing
LoadString = strLoadString
Exit Function
HandleErrors:
MsgBox "basVertaling - LoadString:" & vbNewLine & Err.Number & " "
& Err.Description
Resume exithere
End Function
************************************************** ***************

Hopes this clear. One could always point me at bad code, or better
ways of handling this.
regards,
--
bebelino
Nov 12 '05 #3
Hi,
...
- creating a table tblLanguage with the following fields:
- FormName
- ControlName
- ControlType
- English
- French
How about value lists in combo and list boxes?
How about messages, tool tips, menus?
- on the forms Open event, ...
In case the user changes language while more than one open is open, all
other forms need to be updated too. Better use Activate.
... i would loop through all the items
collection and set the captions of all labels, comboboxes, buttons
etc. according to the appropriate language value in tblLanguage. Is this the common way to do such a task?


That's at least how I do it.

Peter

--
No mails please.
Nov 12 '05 #4
On Wed, 15 Oct 2003 21:18:16 +0200, Peter Doering <no****@doering.org>
wrote:
How about value lists in combo and list boxes?
How about messages, tool tips, menus?


One can easily call the LoadString(languagenr) in code.
So displaying a messagebox could be done like this:

'52 = Hello there
msgbox loadstring(52 + lnglanguage), vbinformation

value lists, tooltips, menus: all can be set via code and the
loadstring.
I really don't know any other way. At least at this moment.
- on the forms Open event, ...


In case the user changes language while more than one open is open, all
other forms need to be updated too. Better use Activate.


Yes, it seems that the activate-event is a better choice.
--
bebelino
Nov 12 '05 #5
I have an example file with the same technique. Email me if interested.

"J?rg Keller" <de**@simsy.ch> wrote in message
news:99**************************@posting.google.c om...
Hi all

I have to localize an Access 2002 application: The application using
several form, tables etc. is currently only in English. Now the
frontend has to be bilingual, so the user can choose if he wants the
form content in English or in French. I have never done something like
this before with Access. One way I think would be like that:

- creating a table tblLanguage with the following fields:
- FormName
- ControlName
- ControlType
- English
- French

- on the forms Open event, i would loop through all the items
collection and set the captions of all labels, comboboxes, buttons
etc. according to the appropriate language value in tblLanguage.

Is this the common way to do such a task? I've heard about the
'Multilingual User Interface Pack' for Office XP, but I think this is
only to change the language for the menues, windows messages etc.,
right? Or would I be able to create multilingual form with the
'Multilingual User Interface Pack'? I couldn't figure it out visiting
the microsoft website.

Any advice would highly be appreciated!

Thank you,

Juerg

Nov 12 '05 #6
On Wed, 15 Oct 2003 19:31:31 GMT, bebelino wrote:
How about value lists in combo and list boxes?
How about messages, tool tips, menus?
One can easily call the LoadString(languagenr) in code.
So displaying a messagebox could be done like this: ...


I placed my question below the OP's language table which is laid out for
captions only. Value lists, menus/sub-menus etc. require a different table
layout. Displaying them is no problem.

Peter

--
No mails please.
Nov 12 '05 #7
de**@simsy.ch (J?rg Keller) wrote:
I have to localize an Access 2002 application: The application using
several form, tables etc. is currently only in English. Now the
frontend has to be bilingual, so the user can choose if he wants the
form content in English or in French. I have never done something like
this before with Access. One way I think would be like that:

- creating a table tblLanguage with the following fields:
- FormName
- ControlName
- ControlType
- English
- French

- on the forms Open event, i would loop through all the items
collection and set the captions of all labels, comboboxes, buttons
etc. according to the appropriate language value in tblLanguage.


One comment one person had a while back was to loop through all the records in the
recordset updating the controls. This is much faster than looping through the
controls collection and doing an indexed read into tables for each control.

You may want to have common transalations for controls, ie "Customer" vs equivalent
in French would appear on many controls in many forms, to appear once in table.
Thus you may wish to have an "expander" routine which will create records in the
table you mention for each occurence of "Customer"

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: qbsu21th | last post by:
Dear Sir/Madam, I'm writing a small VB6.0 and Access 2002 application in XP OS. I selected the data control property RecordSource, I got the "Unrecognized database format 'xxx/xx/*.mdb' " error....
3
by: Bob Darlington | last post by:
I am looking at buying Installshield 11 Professional and Sagekey Access 2002 Runtime Object to facilitate the distribution of my Access 2002 application (having despaired with the PDW). One of the...
2
by: TechBoy | last post by:
I am trying to learn on the fly about Access Security for an app we are developing. I realize Access security is an advanced subject with many details. I wanted to share a scenario and ask a...
1
by: ABB | last post by:
What are the best practices to create n-tier application in Windows Forms? Links to white papers/articles are welcome. We have a medium-size accounting and stock application that are planning to...
6
by: Nate | last post by:
I am in a slight predicament trying to determine the most efficient and effective way to connect/disconnect from a database within a business object (c# dll). I'm also keeping in mind the concept...
2
by: | last post by:
Best practices and recommendations for asp.net 2 multilingual web sites? Thanks
4
by: breadhead | last post by:
Good morning, all. I am creating an Access 2002 application to run on XP clients and I'm struggling with the task of testing whether a single-field record exists before allowing the user to add it...
0
by: Sebastian | last post by:
Hello I develop my applications in Access 2002. My development system is running Windows XP SP2 and I have Microsoft Office XP Developer. Microsoft Office XP is at SP3. I used Inno Setup (great...
1
mikek12004
by: mikek12004 | last post by:
I have a access 2002 application (a file with MDE extension) which when you execute it access 2002 opens and you insert/view/modify data through a series of user-created forms. Assuming that they are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.