I'm hoping someone can help me determine the best way to set up my tables and relationships for an Employee database (contact info, training, work schedules, etc.)
I'm currently stuck on the set-up and proper relationship properties for the following two tables...
tblEmployees
EmpID -PK
LastName
FirstName
Dept (Maintenance Control, Technical Support..)
EmpType (Analsyst, Controller, Supervisor...)
SupID -FK of EmpID via self-join)
Address
...other
tblSupCodes
SupCode -PK (C001, C002...)
Desc (W/E Nights A, W/E Nights B...)
SupID
MgrID
Mon (08:00-17:30, 17:00-01:00...)
Tues
Wed
..other days
-tblSupCodes is a table that applies to only "Controllers" from tblEmployees.EmpType
-Codes basically identify work shifts and groups.
-Each Controller is assigned a SupCode which identifies their supervisor.
-Supervisors can have 1 or several codes (they may supervise several work groups on the same shift).
Here's where I'm stuck...
(1) tblEmployees has a field for SupId (which comes from a self-join on EmpID), but for Controllers I need a field that shows their SupCode. I don't want to use SupCode for Controllers and EmpID for everybody else, nor do I want to have to enter data into two different fields that "should" point to the same supervisor. Should I have both SupID and SupCode fields in tblEmployees? If so, do I leave all SupCode's null if not a controller? If so, do I leave all SupID's null if they are a controller?
(2) For each Controller, I need to also capture their manager MgrID (which can also come from tblEmployees.EmpID). Do I enter MgrID in tblSupCode or tblEmployees? If I put it in tblEmployees do I now create another self-join using tblEmployees_2? Or??
This seems like it should be quite simple but I'm just going around in circles with all the fields and instances that basically identify just a single employee.
(3)Once I get the table/relationship structure squared away, I may also need some help with the best way to create forms for assigning Controllers and Superviors their SupCodes. For example: If a SupCode gets a new SupID (supervisors swap shifts, new sup, etc.) I don't want to have to go to tblEmployees and update all the Controller's SupID's. Controller's keep their SupCode but different supervisors can fill the roll of that SupCode, so each time there's a supervisor change I just want to change it at tblSupCode. But then everything's working differently for only one group of employees...
Any input or assistance will be greatly appreciated!
Mike
I'm currently stuck on the set-up and proper relationship properties for the following two tables...
tblEmployees
EmpID -PK
LastName
FirstName
Dept (Maintenance Control, Technical Support..)
EmpType (Analsyst, Controller, Supervisor...)
SupID -FK of EmpID via self-join)
Address
...other
tblSupCodes
SupCode -PK (C001, C002...)
Desc (W/E Nights A, W/E Nights B...)
SupID
MgrID
Mon (08:00-17:30, 17:00-01:00...)
Tues
Wed
..other days
-tblSupCodes is a table that applies to only "Controllers" from tblEmployees.EmpType
-Codes basically identify work shifts and groups.
-Each Controller is assigned a SupCode which identifies their supervisor.
-Supervisors can have 1 or several codes (they may supervise several work groups on the same shift).
Here's where I'm stuck...
(1) tblEmployees has a field for SupId (which comes from a self-join on EmpID), but for Controllers I need a field that shows their SupCode. I don't want to use SupCode for Controllers and EmpID for everybody else, nor do I want to have to enter data into two different fields that "should" point to the same supervisor. Should I have both SupID and SupCode fields in tblEmployees? If so, do I leave all SupCode's null if not a controller? If so, do I leave all SupID's null if they are a controller?
(2) For each Controller, I need to also capture their manager MgrID (which can also come from tblEmployees.EmpID). Do I enter MgrID in tblSupCode or tblEmployees? If I put it in tblEmployees do I now create another self-join using tblEmployees_2? Or??
This seems like it should be quite simple but I'm just going around in circles with all the fields and instances that basically identify just a single employee.
(3)Once I get the table/relationship structure squared away, I may also need some help with the best way to create forms for assigning Controllers and Superviors their SupCodes. For example: If a SupCode gets a new SupID (supervisors swap shifts, new sup, etc.) I don't want to have to go to tblEmployees and update all the Controller's SupID's. Controller's keep their SupCode but different supervisors can fill the roll of that SupCode, so each time there's a supervisor change I just want to change it at tblSupCode. But then everything's working differently for only one group of employees...
Any input or assistance will be greatly appreciated!
Mike