Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 26th, 2004, 03:58 PM
Registered User
 
Join Date: Apr 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic ColumnWidths in a Listbox

Does anybody know if there is a way to dynamically set the columnwidths of a listbox?

Thanks
 
Old May 27th, 2004, 06:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
Me.lstBox.ColumnWidths = "3cm;4cm;0cm"

Brian Skelton
Braxis Computer Services Ltd.
 
Old May 27th, 2004, 08:01 AM
Registered User
 
Join Date: Apr 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, I should have been more clear. Is there anyway to control the length of a column in a list box based on the length of the data in the column. I don't want the columns to have fixed widths. I have a field from a SQL Query that can be of varying length. Ideally, I would like the listbox to display the entire contents of the column regardless of the length of the field.

Thanks

 
Old May 27th, 2004, 04:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think the only way to do this with a list box is to look at the number of characters in the text and then use calculate it's probable width - messy and inaccurate.


Brian Skelton
Braxis Computer Services Ltd.





Similar Threads
Thread Thread Starter Forum Replies Last Post
help to create dynamic listbox using xslt & JS kramsengg XSLT 7 June 10th, 2008 05:00 AM
multiple Listbox values in another listbox terryv Excel VBA 0 June 27th, 2007 07:01 AM
help writing dynamic form data to dynamic table ublend Classic ASP Professional 1 June 1st, 2007 08:08 AM
Dynamic ListBox Population n Selection nkrust ASP.NET 2.0 Basics 1 January 9th, 2007 05:05 AM
I'm back :) Listbox var from listbox MichaelTJ .NET Web Services 2 October 21st, 2003 07:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.