Combo Box troubles

L

LeahT

I posted a while back about trying to view the combo box differently and
Cindy M. suggested the 2 column way of showing the information.

"Set up the combo box with two columns. Write the numbers into the first one,
the text into the second. Set the "BoundColumn" to the first one, and only
the
information in that column will display when the list is closed."

Sorry for being a novice at this whole combo box thing (have to
admit...starting to hate them)...but I am having trouble understanding how to
get this to work. I don't know how to set up the combo box with 2
columns...although I did find in the properties where to type in the number
2...and of course the "BoundColumn" area. It doesn't seem to work as I would
assume it would though...I don't see 2 actual columns...so how do I seperate
information from column one and column two!?
 
J

Jean-Guy Marcil

LeahT was telling us:
LeahT nous racontait que :
I posted a while back about trying to view the combo box differently
and Cindy M. suggested the 2 column way of showing the information.

"Set up the combo box with two columns. Write the numbers into the
first one, the text into the second. Set the "BoundColumn" to the
first one, and only the
information in that column will display when the list is closed."

Sorry for being a novice at this whole combo box thing (have to
admit...starting to hate them)...but I am having trouble
understanding how to get this to work. I don't know how to set up the
combo box with 2 columns...although I did find in the properties
where to type in the number
2...and of course the "BoundColumn" area. It doesn't seem to work as
I would assume it would though...I don't see 2 actual columns...so
how do I seperate information from column one and column two!?

In what format is you data the you intend to use to populate the combobox?

In any case, here is a simple example:

Dim i As Long
'Declare a two dimensional array
Dim varList(9, 1) As Variant

'Fill the array
For i = i To 9
varList(i, 0) = CStr(i)
varList(i, 1) = "Item" & CStr(i)
Next

With Me.ComboBox1
'Fill the combobox with the array
.List() = varList
'Set up two column
.ColumnCount = 2
'Declare the column that will be used to display/return a value
.BoundColumn = 1
End With



--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
C

Cindy M.

Hi =?Utf-8?B?TGVhaFQ=?=,
"Set up the combo box with two columns. Write the numbers into the first one,
the text into the second. Set the "BoundColumn" to the first one, and only
the
information in that column will display when the list is closed."

Sorry for being a novice at this whole combo box thing (have to
admit...starting to hate them)...but I am having trouble understanding how to
get this to work. I don't know how to set up the combo box with 2
columns...although I did find in the properties where to type in the number
2...and of course the "BoundColumn" area. It doesn't seem to work as I would
assume it would though...I don't see 2 actual columns...so how do I seperate
information from column one and column two!?
Look up the Help item for "Column Property (Forms)", then examine the "Example".
Then look at the List property (through the See also link) and its example.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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