Link to home
Start Free TrialLog in
Avatar of Mike Scott
Mike Scott

asked on

Altering a forms controls text properties to a non-Latin language in Access 2010

I live in Thailand and am developing a small billing application using MS Access 2010. The administrators of the system may be Thai or English speakers and I would like each form to be displayed to them in their preferred language. Effectively I wish to be able to toggle between the 2 languages.

BTW, I am an access novice.

My problem is that I am unable to get any form to correctly render the text string that I have coded in Thai.

For instance, if I have a button called toggle, I want to be able to switch to Thai via the following statement:-

Me.toggle.Caption = "ฤฆฎฑ"

This is not a valid Thai word BTW, just a random series of characters.

Anyway, despite the control having a unicode font that is supposed to support Thai script, it never renders properly, in fact no Thai characters are ever displayed.

I would be grateful if someone could point me in the right direction as this seem to me to be a fairly modest programming aspiration to have!

Many thanks

Regards
Mike
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

It is easy..you just setup a table with mapping between form control names and desired Display names...like this
Form--ControlName----Language--Display
frm1--lblInformation---English-----Information
frm1--lblInformation---Thai---------ฤฆฎฑ
Then on the Load event of each form you load a filtered subset of this table and you do the mappings to the controls you want
Avatar of Mike Scott
Mike Scott

ASKER

Thanks for the reply, but I don't understand what you are saying.

How would this approach be any different from what I am doing on for load like this ....

Me.Label4.FontName = "Garuda"
Me.Label4.Caption = "ฤฤฤฤฤฤ"

Unless you are saying that I am updating the wrong control properties?

If you have any actual working code that you have used before, I would be able to understand that.

Thanks
It would be dynamic...you just fill the table with control name and change the caption everytime according to your preferences
Thank you once again, but could you please explain to me what I am currently doing wrong?
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks John

I understand what you're saying and your suggested approach.

What I don't understand is any intrinsic difference between what your code does and what my extremely simple code does.

I think I must be missing something here, for instance the difference in data stored in a table or coded in a procedure because that's all I can think of that would make your approach work and mine not.

I am using a font that supports Thai, I am using a Thai enabled keyboard, I am using the Thai language pack. This should work but doesn't.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK, thanks

I understand that

I'll use Johns suggestion
you're welcome.

And for the same reason, if you have need to write to a text file, use an ADO stream

you probably want to track what user added and modified records in each table to correlate the English and Thai entries too

be careful not to use reserved words (for instance, use "lang" instead of "language") when you create table and field names:
http://allenbrowne.com/AppIssueBadWord.html
John

Many, many thanks. Your solution worked perfectly.

Apologies for not understanding the difference in holding unicode in fields as opposed to VBA variables.

Mike
Huge thanks to John and Crystal.
Glad you worked it out...
you're welcome ~ happy to help