ACC2000: Sample Function to Determine Language Version
ID: Q210455
|
The information in this article applies to:
Moderate: Requires basic macro, coding, and interoperability skills.
This article applies to a Microsoft Access database (.mdb) and a Microsoft Access project (.adp).
SUMMARY
Microsoft Access ships in and can use several languages. This article shows you how to create a sample function that you can use to determine which language version of Access is installed, which language version the user interface is using, and which language version the Help file is using.
MORE INFORMATION
Access keeps track of language specific information by associating the files with a Local ID (LCID). This function uses the LanugageID property to return the LCID for different parts of Access. The LCID is passed to the LangID function to resolve the LCID into a friendly name for the language. Not all supported languages are handled in this function, but you can add aditional Case statements to handle additional languages.
Microsoft provides programming examples for illustration only, without warranty
either expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes that you
are familiar with the programming language being demonstrated and the tools used to
create and debug procedures. Microsoft support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to provide added
functionality or construct procedures to meet your specific needs. If you have limited
programming experience, you may want to contact a Microsoft Certified Solution Provider
or the Microsoft fee-based consulting line at (800) 936-5200. For more information about
Microsoft Certified Solution Providers, please see the following page on the World Wide Web:
http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the
following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/overview/overview.asp
- Create a new module and type the following line in the Declarations section if it isn't already there:
Option Explicit
- On the Tools menu, click References. Make sure there is a reference to Microsoft Office 9.0 Object Library.
- Type the following procedures:
Sub FindLanguage()
Debug.Print "The language that is installed is: " & _
LangID(msoLanguageIDInstall)
Debug.Print "The language of the user interface is: " & _
LangID(msoLanguageIDUI)
Debug.Print "The language of the help files is: " & _
LangID(msoLanguageIDHelp)
End Sub
Function LangID(LangPart As Long)
Select Case Application.LanguageSettings.LanguageID(LangPart)
Case 1025:
LangID = "Arabic"
Case 1069:
LangID = "Basque"
Case 1046:
LangID = "Brazilian"
Case 1026:
LangID = "Bulgarian"
Case 1027:
LangID = "Catalan"
Case 2052:
LangID = "Chinese - Simplified"
Case 1028:
LangID = "Chinese - Traditional"
Case 1050:
LangID = "Croatian"
Case 1029:
LangID = "Czech"
Case 1030:
LangID = "Danish"
Case 1043:
LangID = "Dutch"
Case 1033:
LangID = "English"
Case 1061:
LangID = "Estonian"
Case 1035:
LangID = "Finnish"
Case 1036:
LangID = "French"
Case 1031:
LangID = "German"
Case 1032:
LangID = "Greek"
Case 1037:
LangID = "Hebrew"
Case 1038:
LangID = "Hungarian"
Case 1040:
LangID = "Italian"
Case 1041:
LangID = "Japanese"
Case 1042:
LangID = "Korean"
Case 1062:
LangID = "Latvian"
Case 1063:
LangID = "Lithuanian"
Case 1044:
LangID = "Norwegian"
Case 1045:
LangID = "Polish"
Case 2070:
LangID = "Portuguese"
Case 1048:
LangID = "Romanian"
Case 1049:
LangID = "Russian"
Case 3098:
LangID = "Serbian (Cyrillic)"
Case 2074:
LangID = "Serbian (Latin)"
Case 1051:
LangID = "Slovakian"
Case 1060:
LangID = "Slovenian"
Case 3082:
LangID = "Spanish"
Case 1053:
LangID = "Swedish"
Case 1054:
LangID = "Thai"
Case 1055:
LangID = "Turkish"
Case 1058:
LangID = "Ukranian"
Case 1066:
LangID = "Vietnamese"
Case Else:
LangID = "unknown"
End Select
End Function
- Type the following line in the Immediate window, and then press ENTER:
FindLanguage
REFERENCES
For more information about Locale identification numbers, click Microsoft Access Help on the
Help menu, type "LCID" in the Office Assistant or the Answer Wizard,
and then click Search to view the topic.
Additional query words:
inf globalization international int'l localization localisation
Keywords : kbprg kbdta AccCon
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbhowto