Auto Fill

T

Turk Ries

Could someone please give guidance on how to make a combo box fill in
multiple fields.

I have a form with a combo box and I have figured out how to make it fill in
a field on that same form. I need it to fill in multiple fields.

For example, if I select a family members name, I want it to fill in the
address field, the city field, etc.

Thank you.
 
D

Douglas J. Steele

Assuming you've got a multi-column combo box, you can put code similar to
the following in the combo box's AfterUpdate event:

Private Sub MyCombo_AfterUpdate()

Me!Text1 = Me!MyCombo.Column(1)
Me!Text2 = Me!MyCombo.Column(2)

End Sub

That will put the contents of the second column of the currently selected
row of the combo box into control Text1, and the contents of the third
column of the currently selected row of the combo box into control Text2.
(The Column collection starts numbering at 0)
 

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