MultiColumn ComboBox Value set/display

G

Guest

I have a two-column ComboBox in a Form.
I am loading the choices via the .List = array
BoundColumn=1 updates a worksheet cell.

When I set the .Value or Choose an item from the pulldown, it only displays
the first column.

How do I set the .Value for the second column and show both columns when an
item is selected from the pulldown.

inTHANKSadvance,
Jim Zeeb
 
D

Dave Peterson

I don't think you can.

You could concatenate the values:

Item1______Description1

so that you only have one column, but that may look kind of funny.

Maybe you could put a label right near the combobox that shows the other
column???
 
B

Bob Phillips

How about using a Listbox?

--
HTH

Bob Phillips

Dave Peterson said:
I don't think you can.

You could concatenate the values:

Item1______Description1

so that you only have one column, but that may look kind of funny.

Maybe you could put a label right near the combobox that shows the other
column???
 
G

Guest

The purpose of this comboBox control is to select one item from a list and
store the value selected in Column 1 (Bound Column) in an Excel worksheet
cell referenced by the .ControlSource property.

I could simulate this by using a locked TextBox, linked using the onClick
event of the comboBox. It just seems like there should be an easy way to
set/display both columns in the comboBox without all this extra code.

....jz

Bob Phillips said:
How about using a Listbox?
 
D

Dave Peterson

I like Bob's idea of a nice listbox more and more.

Jim said:
The purpose of this comboBox control is to select one item from a list and
store the value selected in Column 1 (Bound Column) in an Excel worksheet
cell referenced by the .ControlSource property.

I could simulate this by using a locked TextBox, linked using the onClick
event of the comboBox. It just seems like there should be an easy way to
set/display both columns in the comboBox without all this extra code.

...jz
 
B

Bob Phillips

You can do that with a listbox, and have the same sort of flexibility of a
combobox. Normally a listbox displays more than 1 item at a time, but by
design it doesn't have to, it can show just one. Agreed, it won't dropdown
like a combobox (combo can be styled like a listbox but not vice versa), you
need to click to scroll down. It would be better to show more than one IMO..
Also, if you want headings, listbox always displays the heading if the data
is bound to the listbox, whereas comboboxes only display on dropdowns.

--
HTH

Bob Phillips

Jim Zeeb said:
The purpose of this comboBox control is to select one item from a list and
store the value selected in Column 1 (Bound Column) in an Excel worksheet
cell referenced by the .ControlSource property.

I could simulate this by using a locked TextBox, linked using the onClick
event of the comboBox. It just seems like there should be an easy way to
set/display both columns in the comboBox without all this extra code.

...jz
 

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