Internationalize Text in Your Applications
Problem
You’d like to be able to pop up translated error messages in your applications, based on the currently running language version of Access. You’d also like other text on your forms and reports to adjust automatically based on the current language version. You know there are a number of ways to do this, but you can’t decide which is best. How should you store and retrieve messages in multiple languages?
Solution
The translated version of Access handles its own error messages (in the German version, for example, the Access error messages appear in German). But you do need to translate your own messages if you want your application to run smoothly in other languages. Though there are several methods of handling text, the most generic solution uses a table of messages, which you can look up by ID number.
Load and run the form frmTestMessage
from 04-06.MDB. This form, shown in Figure 4-12, allows you to choose from three different
languages (English, French, and Spanish) in an option group. As you
choose each language, code attached to the option group’s
AfterUpdate event changes accordingly the captions for labels on the
form and the status-bar text for text boxes. To try a sample error
message in the chosen language, click the Test Message button.

Figure 4-12. The sample form, frmTestMessage, showing the French test error message
In each ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access