Populating two text boxes with values from combo box selection

  • Thread starter Thread starter BobRoyAce
  • Start date Start date
B

BobRoyAce

I have a databound combo box that displays three columns. When the user
selects one of the items in the combo box, one of the columns' value is
stored in a field in the underlying table. This works as it should. What I
want to do is blast each of the other two columns data (from selected
item/row in the combo) into two text boxes on the form. Where and how would
I do this?
 
You might be better off using the DLookup function to accomplish this:

You basically set the control source of the text boxes to something like:
=DLookup(expr, domain[, criteria])
e.g.
DLookup("Field", "TableName", "SomeField = " & Forms!FormName!ComboName)
 
try using the After Update event to populate the other controls.
me.txtbox1 = me.cbo.Column(1)
me.txtbox2 = me.cbo.Column(2)
HTH,
Jeff
 
Back
Top