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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Language Feature

Status
Not open for further replies.

svagelis

Programmer
May 2, 2001
121
GR
I was thinking that i could add a feature in my main menu for multiple languages , so captions , texts , etc. appears to the [roper language. The First thing that comes to my head is to insert values in a table (object Name, Nang_Id, Description) but i was wondering , where should i update all those controls - On Load event for every form, or it should be done once when my application starts?
 
Open a Global recordset when the app starts, and populate it with the strings from the selected language table.

When each form loads you can then use a simple function to load the strings from the recordset.

Function SetLang(TheNo as Long) as String
MyLangStr.MoveFirst
MyLangStr.AbsolutePosition = TheNO
SetLANG = MyLangStr.Fields("String")
End Function

Good Points:
The loading of the strings is pretty fast since the recordset is open.
You can change the language at runtime without a restart.

Bad Points:
Because you use AbsolutePosition to get the strings from the recordset you cannot remove any of the strings, or insert any new ones.
You can add new ones to the end, but doing anything else messes with the AbsolutePosition of all the other strings.

Good Luck

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top