Combo Selection

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

Guest

Hi

I have 2 Fields within my Main Data....

Employee ID
Employee Name

I have various Forms where i have done Combo Boxes to select The ID and then
the name.....I am now getting to the stage where there are hundreds of
records to select eaxch time.

Is there any way i can select Employee ID and then it automatically
populates the employee name?? I am pretty sure its possible bu i am not sure
how to do it.

Any ideas?
 
Dava said:
Hi

I have 2 Fields within my Main Data....

Employee ID
Employee Name

I have various Forms where i have done Combo Boxes to select The ID
and then the name.....I am now getting to the stage where there are
hundreds of records to select eaxch time.

Is there any way i can select Employee ID and then it automatically
populates the employee name?? I am pretty sure its possible bu i am
not sure how to do it.

Any ideas?


You shouldn't need to store anything other than the EmployeeID. Once having
that you can use various methods to "retrieve and display" the employee name.
This is the proper way to work with related data in tables. Retrieve it, don't
copy it. In your case I would have an *unbound* TextBox on the form next to the
EmployeeID control with a ControlSource of...

=EmployeeID.Column(1)

Then I would add a column to the EmployeeID ComboBox (hidden) that included the
EmployeeName. Any existing record I look at will *display* the appropriate name
and I don't have to copy it. In addition, if an employee's name were to change
I do not have to manually update all past records where I had copied their name
previously. Those records would just display the correct name automatically.
 
Thanks Rick, I got there eventually!!

Rick Brandt said:
You shouldn't need to store anything other than the EmployeeID. Once having
that you can use various methods to "retrieve and display" the employee name.
This is the proper way to work with related data in tables. Retrieve it, don't
copy it. In your case I would have an *unbound* TextBox on the form next to the
EmployeeID control with a ControlSource of...

=EmployeeID.Column(1)

Then I would add a column to the EmployeeID ComboBox (hidden) that included the
EmployeeName. Any existing record I look at will *display* the appropriate name
and I don't have to copy it. In addition, if an employee's name were to change
I do not have to manually update all past records where I had copied their name
previously. Those records would just display the correct name automatically.
 
Back
Top