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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading from a Muli Column ComboBox - Word 1

Status
Not open for further replies.

nochoice

Programmer
Jun 17, 2003
72
CA
Hey Everybody,

OK here's my problem - this is starting to sound vaguely familiar:

I have a multi column combobox that has been populated using the following code:

ml.OLEFormat.Object.Column() = myarray

This is what I can't do:

I want to search through the combobox and when it finds an entry in the first column - 0 - that equals "aa152c126" I want it to display a message box containing the second column text - 1 - of the same entry

A little clarification:

here's my combobox:

aa001a100 Introduction
aa152c126 Chapter 1
aa003a100 Chapter 2

So when my macro is run I get a message box displaying the following:

Chapter 1

Thanks in Advance,
NoChoice

 
This is my solution:

Mycombobox.BoundColumn = 1
MsgBox MyCombobox.value

Mycombobox.BoundColumn = 2
MsgBox MyCombobox.value


Displays the following:

aa152c126

Chapter 1


I hope this helps anybody who's interested in reading from a multicolumn Combo or List box.

Cheers,
NoChoice
 
Thanks NoChoice, your question that you asked was perfect. I had the same problem with business names and contacts in a combobox and needed the contact selected to be searched against a database and I tried all kinds of stuff and was getting frustrated and about to just change the column order in the combobox. But I decided that I would check Tek-Tips first and behold! Thank you again.


Charles
Walden's Machine, Inc.
Quality Assurance/Office Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top