Combo boxes

C

Chantelle Wynn

I have a combo box with a unique ID number e.g. 1, 2 etc and I want access to
then relate this to a person and put this information into 2 text boxes -
first and last names. Cannot figure out how to do this!!
 
R

Rick Brandt

Chantelle Wynn said:
I have a combo box with a unique ID number e.g. 1, 2 etc and I want access to
then relate this to a person and put this information into 2 text boxes -
first and last names. Cannot figure out how to do this!!

Do you just want to store the ID and *display* the name fields? That would be
the correct way to do it. Or do you want to copy the name field data and save
it in your record? That would (generally) be the incorrect way to do it.

To do it the correct way add those two name fields as additional columns in your
ComboBox (hidden if you like). Then use ControlSource entries in your TextBoxes
of...

=ComboBoxName.Column(1)
=ComboBoxName.Column(2)
 
R

Rick Brandt

Chantelle Wynn said:
How do I add them as additional columns within the combo box?

Change the ColumnCount property to 3
Set the ColumnWidths property to 1";0";0" (whatever you want for the 1")
Change the RowSource query so that it includes the other fields

This assumes that the same table you are getting the ID column from also
contains the first and last name fields.
 
Top