Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing listbox columnwidth at runtime

Status
Not open for further replies.

gdev

Technical User
Mar 12, 2001
38
0
0
Hi,

I have 6 comboboxes. The user wants to be able to sort/filter in any combination with these comboboxes.
I have decided to change the rowsource(query) after each combobox update.
All of my data is displayed is a listbox.
My first problem is I can't seem to get the listbox columnwidth to change after an update.
Listbox.Columncount works perfectly. However, Access seems to be entering its own very small columnwidth sizes.

Please help.

Thanks
gdev
 
They probably work in Twips. Set something manually, then do a Debug.Print of it.

One of mine, with 2 columns and 1.217cm;5cm turns up as 690;2835

Knowing then that there are 1440 twips per inch and 567 twips per centimer should make it possible to work with it.

Roy-Vidar
 
gdev,

Me.List0.ColumnWidths = "1.5in;1.3in"

You can specify in whatever unit of measure you prefer. The above example is using inches, or you can use Roy's twips if you omit the unit. Replace list0 with the name of your listbox.
 
Wonderful People, Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top