storing info from a multicolumn combo box into text box

T

Tippin

I have a subform that has a multicolumn combo box. 4
columns and I want to select a row fromt he drop down and
store the data in the row I selected into text boxes.

How do I do that.

My data looks like this:

column 1 column 2 column 3 column4
Wall Silver $99.99
Wall Gold $99.53
Wall Black $102.00
Sill Silver $838.99
Sill Gold $1.24

I have tried referencing combobox.column() after I select
a row and I keep getting the 1st occurrance of data. For
instance I would select Wall Gold $99.53 and I
would get Wall Silver $99.99 in my text boxes.
How do I reference the correct column and row?
 
S

Sandra Daigle

Which column is the bound column of the combo?

The field in the bound column of the combo needs to be a field that uniquely
identifies the selected row.
 
J

Jen

Hi,

On the combo box click event, you'll want to do something
like so:

txtCol1.Value = cboName.Column(0) ' field 1
txtCol2.Value = cboName.Column(1) ' field 2
txtCol3.Value = cboName.Column(2) ' field 3
txtCol3.Value = cboName.Column(3) ' field 4

Of course you'll need to change the names of the controls
to match what you have.

Regards,
Jen
 

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