Auto Populate a Combo Box based on the user selection of another Combo Box

  • Thread starter Pasadena-D via AccessMonster.com
  • Start date
P

Pasadena-D via AccessMonster.com

I have a form that has 3 Combo Boxes; 1) Personnel Number, 2) First Name, 3)
Last Name. The Row Source for each Combo Box is "tblPersonnel_Number", and
each Combo Box is assigned to their respective Control Source by name. When
the user selects their Personnel Number I'd like the First Name, and Last
Name to populate automatically. I found out how to do this by using
"=Personnel_Number.column(2)" for First Name, and "=Personnel_Number.column(3)
" for Last Name, but when I close the form it saves the Personnel Number into
"tblPersonnel_Number" but not the First Name and Last Name. Is there another
way to automate this, but keep the Control Source assigned to their
respective Control Source by name?
 
P

PieterLinden via AccessMonster.com

Pasadena-D said:
I have a form that has 3 Combo Boxes; 1) Personnel Number, 2) First Name, 3)
Last Name. The Row Source for each Combo Box is "tblPersonnel_Number", and
each Combo Box is assigned to their respective Control Source by name. When
the user selects their Personnel Number I'd like the First Name, and Last
Name to populate automatically. I found out how to do this by using
"=Personnel_Number.column(2)" for First Name, and "=Personnel_Number.column(3)
" for Last Name, but when I close the form it saves the Personnel Number into
"tblPersonnel_Number" but not the First Name and Last Name. Is there another
way to automate this, but keep the Control Source assigned to their
respective Control Source by name?

Why do you want to save this information again? If you need to get it, use a
query.
 
P

Pasadena-D via AccessMonster.com

PieterLinden said:
I have a form that has 3 Combo Boxes; 1) Personnel Number, 2) First Name, 3)
Last Name. The Row Source for each Combo Box is "tblPersonnel_Number", and
[quoted text clipped - 6 lines]
way to automate this, but keep the Control Source assigned to their
respective Control Source by name?

Why do you want to save this information again? If you need to get it, use a
query.
there are text boxes that the user has fill out, which are different than the
combo box information....so they fill out the 3 combo boxes, then the text
boxes, then hit the ok button to save the records to the data table
 
J

John W. Vinson

PieterLinden said:
I have a form that has 3 Combo Boxes; 1) Personnel Number, 2) First Name, 3)
Last Name. The Row Source for each Combo Box is "tblPersonnel_Number", and
[quoted text clipped - 6 lines]
way to automate this, but keep the Control Source assigned to their
respective Control Source by name?

Why do you want to save this information again? If you need to get it, use a
query.
there are text boxes that the user has fill out, which are different than the
combo box information....so they fill out the 3 combo boxes, then the text
boxes, then hit the ok button to save the records to the data table

Pieter's question is:

If you are storing the Personnel Number, WHY would you want to also store the
first and last name, redundantly?

These fields should exist in tblPersonnel_Number *AND NOPLACE ELSE*. That's
how relational databases work! You would use a combo to display the name
(while storing the number), or a Query joining the two tables... but you would
not copy the name.
 
P

Pasadena-D via AccessMonster.com

I understand what both of you are saying now. I changed my tables and it
works great now. Thanks!
[quoted text clipped - 7 lines]
combo box information....so they fill out the 3 combo boxes, then the text
boxes, then hit the ok button to save the records to the data table

Pieter's question is:

If you are storing the Personnel Number, WHY would you want to also store the
first and last name, redundantly?

These fields should exist in tblPersonnel_Number *AND NOPLACE ELSE*. That's
how relational databases work! You would use a combo to display the name
(while storing the number), or a Query joining the two tables... but you would
not copy the name.
 

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