One More Combo Box Question

sondriven

Registered User.
Local time
Today, 12:29
Joined
Jun 13, 2002
Messages
158
Is this a possiblity for a combo box?

I have an inventory program that uses a part number and a description. I want to select a part number from the combo box and have the part number and description be entered in the same box. Or is there a way to join these two after they are selected?

Thanks
 
It's absolutely possible. Just feed multiple columns into the combo box (either in your query or value list). Change how the columns are displayed by specifying the column count, the column widths, and the bound column number.
 
Hi

I have a query to give me the part number and descriptions. I made a combo from that. So I have 2 columns. I set the Bound Column to 2. The widths are 2" and 2" and the Column Count to 2. It shows both columns when I drop down the list but after I make my selection only 1 of the columns is entered into the field.

I want both columns to be entered in the field. Dont know if I was clear or not. Is this possible?

Thanks
 
A combo box will store only a single value even if it contains multiple columns. If the 2nd column is bound, that will be the column which has the value which will be stored. If you need to get to data in the first column, use an expression of this type: cboComboBox.Column(0).

For example, you can assign the value of the first column of that combo box to a text field called txtText1 on your form using this code in the AfterUpdate event of the combo box:
Me.txtText1=Me.cboComboBox.Column(0).
 

Users who are viewing this thread

Back
Top Bottom