get the language of MS access

Andy74

Registered User.
Local time
Today, 23:37
Joined
May 17, 2014
Messages
126
Hello Everybody,

when setting properties of forms or controls the property value is a boolean ("true" and "false"). Unfortunately I have noticed that for different language package the property value can change. So when an application is used in MS Access runtime with a different language then the properties should be set to a different values ("vero" and "falso"), for instance for italian. Is there any way to skip this or to detect the language of the version and then set the property correctly? I have the same application run by different versions of MS Access runtime and I would like to avoid a customized application of each of them!

andy74
 
I use true/false in my applications and have no problems runing them on Hebrew systems
 
I found a solution by defining a variable as follows:

intLang = Application.LanguageSettings.LanguageID(msoLanguageIDUI)

If this parameter is 1030 then language is english. If it is 1040 then it is Italian and so fort. The complete list is here: http://msdn.microsoft.com/it-it/goglobal/bb964664.aspx
 
Surely it is still true and false.

It must be a keyword, rather than natural language.

Not certain, though.
 
well, at the beginning I also thought that it would be a keyword, but my Italian version doesn't accept "true" and "false" as value of properties through VBA.
 
True/False is a type of number

True=-1
False=0

numbers are international so should solve the problem

The numeric property can be used in formula e.g.

myNumber=1234*abs(myYesNo)

will return 1234 if myYesNo is true and zero if false - much less code than

if myYesNo=true then myNumber=1234 else myNumber =0

- or using a case statement
 

Users who are viewing this thread

Back
Top Bottom