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

Combo Box - Displaying both columns after selection 1

Status
Not open for further replies.

Nate1749

Programmer
Nov 1, 2002
204
US
When I pull down my combo box two items are shown,
Site Name URL

When I select one, only Site Name shows up.... Is there a way to have Site Name & URL show up exactly the way it appears when you pull it down (I like the dedicated space & line)....

I was thinking of making another text box and then having an after update event that drops the 2nd (tehcnially 3rd) column in it. I would strategically place that text box on the last half of combo box list to make it look identical as it looks when it's pulled down (same spacing)....

However, isn't there a more "proper" way to accomplish this?

Thanks,

-Nate
 


How about concatenating the Site name and URL fields in a query then change your RowSource property to point to this query?

Problem is the bound column of your combo box will be the 2 fields strung together. But you can probably work around that ...

Good luck
 
I have a similar proble. I have the product and part number. I wanted once i select product the part number should also come up. Now i have taked 2 seperate combo box. In the form i have to select both seperately.
any solution?
 
Easy way. Next to tthe combo box create a test box no label. On the update event of the combo box use the following code

me.newtxtbox.value = me.combobox.column(1).value

What this does is read the value of the second column form the combo box and places it in the text box all by itself.

Good luck
ssecca
 
confused. sorry ssecca
I tried and it gave a macro error.
 
A combo box can display multiple fields for the purpose of selecting an item. However, once a selection is made only one field can be chosen to appear in the actual text box display area of the combo. The other fields are still available to use, you use them via the command

me.combobox.column(1).value

Where combobox is the control name on your form for the combobox i question. column() refers to the physical postion of the data as defined by the underlying query that populates the combo box lookup list starting from column 0.

So if on the update event of your combo box you place the code

me.newtxtbox.value = me.combobox.column(1).value

Where newtxtbox is the control name of the new text field you just added and combobox is the name of the exsiting combobox then when ever the combobox gets a new selection the update event will auto fill the nestxtbox with the contents of the second column of the pull down list.

Hopefully this helps, if you need more input e-mail me and I will try to put togeather a sample for you.

Good luck
ssecca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top