Listbox column widths and Internationalization !!!

  • Thread starter Savvoulidis Iordanis
  • Start date
S

Savvoulidis Iordanis

I work with the english version of Access 2K, so when I set the column
widths of a listbox/combobox dynamically, through code, I have to use the
"cm;" unit. When the application is run over the Greek localized version of
Access, this gives a runtime error, because in Greek, the unit is "åê.;"
(fullstop included, with greek characters "å : epsilon (e)" and "ê : kapa
(k)", that is "ek.;" but in Greek)

How can I determine the language version of access that my app is run under?
 
G

Graham Mandeno

Hi Savvoulidis

When you set dimensions of form/report objects through code, the unit of
measure is the "TWIP". A TWIP is one twentieth of a point, so there are
1440 TWIPs per inch (one inch is 72 points).

To convert from centimetres then, you must multiply by 567 (1440/2.54~=567).

ColumnWidths is a string property, but still the unit is TWIPs, so if you
want to set the column widths of a listbox to 2cm and 1cm, in code you would
say:
MyListbox.ColumnWidths = "1134;567"

I use a function as follows:
Public Function CmToTwips( cm as single) as integer
CmToTwips = cm * 567
End Function

This makes code somewhat more readable - for example:
MyListbox.ColumnWidths = CmToTwips(2) & ";" & CmToTwips(1)
 
S

Savvoulidis Iordanis

Thanks, I'll try that.
Anyway, how can I get the language type of Access (English, Greek, etc)?
 
D

Douglas J Steele

Assuming you've got a reference set to Access, you can look at the
database's CollatingOrder property:

CurrentDb.CollatingOrder

That should return dbSortGreek (1032) if it's a Greek database,
dbSortGeneral (1033) if it's English, French, German, Portuguese, Italian or
Modern Spanish, or one of a number of other values for other languages.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top