View One column of Multi Column Listbox 
Author Message
 View One column of Multi Column Listbox

Hi,

I have a list box that in a user form that actually has two columns, but I
only want one column to be visible.  I load the list into this list box from
a two column table in another document.

I only want the user to see data from the first column, but after they make
selections from the list box, data from BOTH columns will be inserted into
the document generated by the template containing the form.

For the list box properties I tried setting the Bound Column, Column Count,
and Text column all to 1, but I still see data from both columns when the
form loads.

How can I use both columns but limit the list box display to the first one?

Many thanks!



Thu, 10 Feb 2005 07:37:54 GMT  
 View One column of Multi Column Listbox
Hi Laura,

You will need the ColomnCount set to 2, and set the width of the first
column to match the width of the list box and the width of the second column
to 0.

Please post any response to the newsgroups for the benefit of others who may
also be following the thread.

Hope this helps,
Doug Robbins - Word MVP

Quote:
> Hi,

> I have a list box that in a user form that actually has two columns, but I
> only want one column to be visible.  I load the list into this list box
from
> a two column table in another document.

> I only want the user to see data from the first column, but after they
make
> selections from the list box, data from BOTH columns will be inserted into
> the document generated by the template containing the form.

> For the list box properties I tried setting the Bound Column, Column
Count,
> and Text column all to 1, but I still see data from both columns when the
> form loads.

> How can I use both columns but limit the list box display to the first
one?

> Many thanks!



Thu, 10 Feb 2005 13:34:48 GMT  
 View One column of Multi Column Listbox
Hi Laura,

What's missing the ColumnWidth property setting.  Whenever you load an array
into a listbox or combobox and the array has more dimensions (= columns) than
you want displayed, just set the widths of the corresponding columns to zero,
and size the width(s) of the other(s) to total the width of the box.  So in
your case, if we assume your combobox is, say, 100 points wide, you'll want
its ColumnWidth string to say 100;0

(The ColumnWidth string always looks a little odd compared to other control
properties, and in my view could be better documented.  The helpfile example,
in '97 at least, doesn't even show you a nice ordinary one....)

--

Reply ONLY to the newsgroup.  Note: MVPs do not work for Microsoft.
MVP FAQ: http://www.mvps.org/word
Userform demystification: http://www.speakeasy.org/~mtangard/userforms.html
"Life is nothing if you're not obsessed." --John Waters

Quote:

> Hi,

> I have a list box that in a user form that actually has two columns, but I
> only want one column to be visible.  I load the list into this list box from
> a two column table in another document.

> I only want the user to see data from the first column, but after they make
> selections from the list box, data from BOTH columns will be inserted into
> the document generated by the template containing the form.

> For the list box properties I tried setting the Bound Column, Column Count,
> and Text column all to 1, but I still see data from both columns when the
> form loads.

> How can I use both columns but limit the list box display to the first one?

> Many thanks!



Thu, 10 Feb 2005 15:19:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Checkbox in multi-column listbox or grid column?

2. Multi-column listbox w/3 columns of checkboxes

3. Multi-column listbox w/3 columns of checkboxes

4. Help Needded How I Create Listbox That Look Like Multi Column Listbox

5. Help Needed How I Create Listbox That Look Like Multi Column Listbox

6. Help Needed How I Create Listbox That Look Like Multi Column Listbox

7. Multi Column TextBox Column Widths

8. Help with displaying second column in multi column combo box

9. Column headings in multi-column combo box

10. Formatting columns in a multi-column ComboBox

11. Exporting multi-column details to word, rtf or xls comes out single-column

12. List View Column - - Possible items in a Single Column

 

 
Powered by phpBB® Forum Software