same data source for combo

G

Guest

hi,

I have a table ( called handover- takeover table) which among other fields
has fields employee ID (which is also a primary key) and employee name
field.

I was trying to make a form where I can enter handover of documents from one
employe to the other employe . For this I created a data entry form with
combo box "Handover from" this combo box selects the employee names from
above mentioned table. next combo box is "employee ID" which automatically
selects the corresponding employee ID once I selects the name.

The I have another column called "Handover to" which also selects the name
from the same table. then next combo box is employee ID, which is
automatically selected once I select the name in "Handover to" box.

Now my problem is, once I select the name in "Handover from" the employee
Id is automatically selected (thats fine) BUT then "Handover to" and
corresponding employee ID is automatically set same as that of "Handover
from" and its corresponding employee ID. If I change the name in ""Handover
to" combo the "handover from" is also chanegd and identical to " handover
to". This is bothering me.

I do not want "Handover from" and "handover to" is linked. they must be
linked only to their corresponding employee ID. I would like to select names
in either of combo box independent of each otheralthough they have the same
source. How to do this.? Please help
 
J

Jeff Boyce

I can't tell from your description, but it sounds like you have employee
name & ID fields in your [handover-takeover] table.

If so, this is not necessary, nor a good idea in a relational database
(e.g., Access/JET). Instead, have a table that holds employee info (ID,
FName, LName, DOB), and a table for your [handover-takeover] data.

In that second table, you'll only need to store the EmployeeID value to
"point back" to the person in the employee table.

Or have I misunderstood?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
G

Guest

it sounds like you have employee
name & ID fields in your [handover-takeover] table.

yes thats true.

Now, you mean I have to create different tables for that? Ok i will do that
but

you said "In that second table, you'll only need to store the EmployeeID
value to
"point back" to the person in the employee table."

I am not sure how to do that,( I am not that good in access)




Jeff Boyce said:
I can't tell from your description, but it sounds like you have employee
name & ID fields in your [handover-takeover] table.

If so, this is not necessary, nor a good idea in a relational database
(e.g., Access/JET). Instead, have a table that holds employee info (ID,
FName, LName, DOB), and a table for your [handover-takeover] data.

In that second table, you'll only need to store the EmployeeID value to
"point back" to the person in the employee table.

Or have I misunderstood?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


senkurion said:
hi,

I have a table ( called handover- takeover table) which among other fields
has fields employee ID (which is also a primary key) and employee name
field.

I was trying to make a form where I can enter handover of documents from one
employe to the other employe . For this I created a data entry form with
combo box "Handover from" this combo box selects the employee names from
above mentioned table. next combo box is "employee ID" which automatically
selects the corresponding employee ID once I selects the name.

The I have another column called "Handover to" which also selects the name
from the same table. then next combo box is employee ID, which is
automatically selected once I select the name in "Handover to" box.

Now my problem is, once I select the name in "Handover from" the employee
Id is automatically selected (thats fine) BUT then "Handover to" and
corresponding employee ID is automatically set same as that of "Handover
from" and its corresponding employee ID. If I change the name in ""Handover
to" combo the "handover from" is also chanegd and identical to " handover
to". This is bothering me.

I do not want "Handover from" and "handover to" is linked. they must be
linked only to their corresponding employee ID. I would like to select names
in either of combo box independent of each otheralthough they have the same
source. How to do this.? Please help
 
J

Jeff Boyce

One table for employees:
tblEmployee
EmployeeID (primary key - row identifier)
FirstName
LastName
DateOfBirth

One table for handover-takeover:
trelHandOverTakeOver
HandOverTakeOverID (primary key)
HandOverEmployeeID (a "foreign key", used to "point back" to which
employee)
TakeOverEmployeeID (another foreign key, also used to point back...)

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


senkurion said:
it sounds like you have employee
name & ID fields in your [handover-takeover] table.

yes thats true.

Now, you mean I have to create different tables for that? Ok i will do that
but

you said "In that second table, you'll only need to store the EmployeeID
value to
"point back" to the person in the employee table."

I am not sure how to do that,( I am not that good in access)




Jeff Boyce said:
I can't tell from your description, but it sounds like you have employee
name & ID fields in your [handover-takeover] table.

If so, this is not necessary, nor a good idea in a relational database
(e.g., Access/JET). Instead, have a table that holds employee info (ID,
FName, LName, DOB), and a table for your [handover-takeover] data.

In that second table, you'll only need to store the EmployeeID value to
"point back" to the person in the employee table.

Or have I misunderstood?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/


senkurion said:
hi,

I have a table ( called handover- takeover table) which among other fields
has fields employee ID (which is also a primary key) and employee name
field.

I was trying to make a form where I can enter handover of documents
from
one
employe to the other employe . For this I created a data entry form with
combo box "Handover from" this combo box selects the employee names from
above mentioned table. next combo box is "employee ID" which automatically
selects the corresponding employee ID once I selects the name.

The I have another column called "Handover to" which also selects the name
from the same table. then next combo box is employee ID, which is
automatically selected once I select the name in "Handover to" box.

Now my problem is, once I select the name in "Handover from" the employee
Id is automatically selected (thats fine) BUT then "Handover to" and
corresponding employee ID is automatically set same as that of "Handover
from" and its corresponding employee ID. If I change the name in ""Handover
to" combo the "handover from" is also chanegd and identical to " handover
to". This is bothering me.

I do not want "Handover from" and "handover to" is linked. they must be
linked only to their corresponding employee ID. I would like to
select
names
in either of combo box independent of each otheralthough they have the same
source. How to do this.? Please help
 

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