populate text box with data from combo box selection

G

Guest

I have a form that has a combo box and 2 text boxes. The combo is populated
via a select and has 3 columns, FieldA , FieldB, and FieldC. When the user
selects FieldA in the combo box, I want to autopopulate the two text fields
with the FieldB and FieldC values that coorespond to the FIELDA selection.
The text fields cannot be editable.

I've tried several variants on thing, but nothing has worked.

Thanks,
Dan
 
G

Guest

You use the column reference for the combo box. Column numbering starts with
0, so second column is 1 and third column is 2.

The code should go in the After Update event of the combo:

Me.txtBoxForB = Me.MyCombo.Column(1)
Me.txtBoxForC = Me.MyCombo.Column(2)
 

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