Populating two text boxes with values from combo box selection

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?
 
J

James Goodman

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)
 
J

JeffW

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
 

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