Set Combo Box Column Width for global app

B

Bill Sturdevant

I use the following code to successfully adjust the column
widths of a combo box in my App.

This works in the US:
Me.ComboBox.ColumnWidths = "0 in;2 in;0 in;0 in"
OR
Me.ComboBox.ColumnWidths = "0 cm;3.81 cm;0 cm;0 cm"
BUT this does not work:
Me.ComboBox.ColumnWidths = "0;2;0;0"

When I run the code in Germany, none of the above works!

This app has to be global!

What unit of measurement can I use to ensure the code
works anywhere in the world?
 
W

Willi Wipp

Hi Bill,

try it with
Me.ComboBox.ColumnWidths = "0;2161;0;0"
It is easier if you don't use "cm" or "in", but Twips.
1,440 Twips is equal to 2.54 cm oder 1 inch.

So your last try did work, but the column was very small,
only 2 twips!
The easiest way to get the number of twips is to input the
values
in the design view, mark the combo and change to the VBA-
Editor.
There the corresponding values are shown in Twips.
 

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