Updating two table fields with one combo box

  • Thread starter Thread starter Shawn
  • Start date Start date
S

Shawn

I have a form which records assignments for employees in
a table (tblassignments). On the form, the block for
assigning an employee is a combo box which displays the
employee's name and employee number from the employee
table (tblemployees). The employee's name is then saved
in the corresponding field on the assignment table
(tblassignments). How can I get the employee number from
the combo box to save in the employee number field in the
table?

Thanks for any help?

Shawn
 
I have a form which records assignments for employees in
a table (tblassignments). On the form, the block for
assigning an employee is a combo box which displays the
employee's name and employee number from the employee
table (tblemployees). The employee's name is then saved
in the corresponding field on the assignment table
(tblassignments). How can I get the employee number from
the combo box to save in the employee number field in the
table?

I would strongly suggest that you do NOT store the employee's name in
the assignments table at all. Names are not unique; and they can
change. You're using a relational database - use it relationally!

Store the unique EmployeeID in the table, by using it as the Control
Source of the combo; and when you need to see that employee's name,
use a query to look it up by joining tblEmployees to the query, or by
using a combo box which stores the ID but displays the name.
 
Back
Top