T
Tom
I am in need for some suggestions as to how I should
design the relationship between 2 tables (one for "Jobs"
and a second one for "Personal"). Throught the rest of
this explanation, I will refere to the tables as...
Tbl_A = Jobs
Tbl_B = Personal
Obviously, Tbl_A contains data about jobs (e.g. title,
job description) while Tbl_B contains data about the
employees (e.g. name, education).
So far so good... here's the problem now. In Tbl_B, I
will have (in some instances) 2 people pointing to the
same job.
The first person has been holding the job in the past and
is scheduled to leave the company in the near future.
The second person is his/her scheduled relief and works
with "employee # 1" for a short period of time during the
transition phase.
Let me provide some example data -- VERSION 1:
Tbl_A Tbl_B
RecID Title JobDesc RecID Name Education
01 Analyst ABC 01 Jack B.A.
02 Engineer XYZ 02 Ben M.S.
02 Sue M.S
03 Manager DEF 03 Carol B.S.
03 Mike B.A.
04 Analyst ABC 04 Tom B.S.
As demonstrated, in this example, the RecordIDs 02 & 03
are currently staffed by 2 individuals each.
In such case, I would use a One-To-Many relationship.
However, I am not sure if that's what I want... at this
time, the record of jobs does not equal "4" (when joined)
due the the dups. Grouping is also not an option since
the personal table contains additional fields (beyond
name and education), so I would not get the proper count.
DESING VERSION # 2:
Tbl_A Tbl_B
RecID Title JobDesc RecID Name Education
01 Analyst ABC 01 Jack B.A.
02 Engineer XYZ 02 Ben M.S.
021 Sue M.S
03 Manager DEF 03 Carol B.S.
031 Mike B.A.
04 Analyst ABC 04 Tom B.S.
In this case, all RecIDs are unique (02 & 021, 03 &
031). However, once the employee who currently holds the
position (RecID = 02, 03) leaves the company [AND THEIR
RECORD WILL BE MOVED OUT OF THIS TABLE], I have lost the
connection between the following:
- Job RecID 02 != Personal RecID 021
- Job RecID 03 != Personal RecID 031
So, again, how would you design and overcome this
problem? Again, a one-to-many relationship might not be
possible, but then... maybe you know of something I can't
think of?!
A possible solution would be to throw a message box (when
deleting or moving the primary/current employee) out of
the table. For instance, when the employee is i.e.
deleted, I get a message box that says: "Please change
RecId from temporary employee to permanent employee!"
In this case, I would get reminded to change i.e. "021"
to "02" & "031" to "03". This would ensure data
integrity... but it seems not very efficient at the same
time.
Or, if the primary employee is "flagged" (boolean =
true), I cannot delete his/her record until I set it to
false and made the relief position = true.
As you can see, I am struggling a bit w/ this problem.
Maybe there's an easy answer I just can't seem to think
of ...
Any help in this is greatly appreciated!!!
THANKS!
Tom
design the relationship between 2 tables (one for "Jobs"
and a second one for "Personal"). Throught the rest of
this explanation, I will refere to the tables as...
Tbl_A = Jobs
Tbl_B = Personal
Obviously, Tbl_A contains data about jobs (e.g. title,
job description) while Tbl_B contains data about the
employees (e.g. name, education).
So far so good... here's the problem now. In Tbl_B, I
will have (in some instances) 2 people pointing to the
same job.
The first person has been holding the job in the past and
is scheduled to leave the company in the near future.
The second person is his/her scheduled relief and works
with "employee # 1" for a short period of time during the
transition phase.
Let me provide some example data -- VERSION 1:
Tbl_A Tbl_B
RecID Title JobDesc RecID Name Education
01 Analyst ABC 01 Jack B.A.
02 Engineer XYZ 02 Ben M.S.
02 Sue M.S
03 Manager DEF 03 Carol B.S.
03 Mike B.A.
04 Analyst ABC 04 Tom B.S.
As demonstrated, in this example, the RecordIDs 02 & 03
are currently staffed by 2 individuals each.
In such case, I would use a One-To-Many relationship.
However, I am not sure if that's what I want... at this
time, the record of jobs does not equal "4" (when joined)
due the the dups. Grouping is also not an option since
the personal table contains additional fields (beyond
name and education), so I would not get the proper count.
DESING VERSION # 2:
Tbl_A Tbl_B
RecID Title JobDesc RecID Name Education
01 Analyst ABC 01 Jack B.A.
02 Engineer XYZ 02 Ben M.S.
021 Sue M.S
03 Manager DEF 03 Carol B.S.
031 Mike B.A.
04 Analyst ABC 04 Tom B.S.
In this case, all RecIDs are unique (02 & 021, 03 &
031). However, once the employee who currently holds the
position (RecID = 02, 03) leaves the company [AND THEIR
RECORD WILL BE MOVED OUT OF THIS TABLE], I have lost the
connection between the following:
- Job RecID 02 != Personal RecID 021
- Job RecID 03 != Personal RecID 031
So, again, how would you design and overcome this
problem? Again, a one-to-many relationship might not be
possible, but then... maybe you know of something I can't
think of?!
A possible solution would be to throw a message box (when
deleting or moving the primary/current employee) out of
the table. For instance, when the employee is i.e.
deleted, I get a message box that says: "Please change
RecId from temporary employee to permanent employee!"
In this case, I would get reminded to change i.e. "021"
to "02" & "031" to "03". This would ensure data
integrity... but it seems not very efficient at the same
time.
Or, if the primary employee is "flagged" (boolean =
true), I cannot delete his/her record until I set it to
false and made the relief position = true.
As you can see, I am struggling a bit w/ this problem.
Maybe there's an easy answer I just can't seem to think
of ...
Any help in this is greatly appreciated!!!
THANKS!
Tom