Auto Fill Text Box from Previous Combo Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form that has 2 fields, Company Name (a combo box) and Company ID (a
text box). When I click on one of the entries in the combo box, I want the
information from a table called 'Agreement Information' to take the company
ID associated with the Company Name and fill it in the text box
automatically. I'm not well-versed in this, so the more detail the better in
a reply.

TIA,

Scott
 
Hi, Scott.

If you created your combo box with the wizard, and selected both the key
field Company ID and Company Name fields, and then chose "Hide Key Field",
the solutiion is easy. If you didn't, it's probably quickest to go delete
the existing combo box, and recreate it with the wizard so you can implement
the solution.

Once the combo box is as described, set the Control Source of the textbox to
the value of the column of the chosen combo box record, using the Column
property of the combo box:

= YourComboBoxName.Column(0)

See VBA Help on the Column property for more information.

HTH
Sprinks
 
Back
Top