Thanks...date is on my written table design, I forgot to type it in.
You don't need ShiftID in TblEmployee. Fields in TblEmployee should relate
directly to describing the employee. TblShiftWorked tells you what shift any
employee worked. BTW, you need date worked in that table to make ShiftWorked
meaningful.
To get a list of dayshift employees, create a query based on TblShiftWorked
and TblEmployee joined on EmployeeID. TblEmployee is included to get the
employee's name. Include ShiftID in the query. You need form to specify the
shift and to open the report. Call the form, PFrmShiftToPrint, and out a
combobox based on TblShift on the form to select the shift to print. Put the
following expression in the criteria of the ShiftID field in the query:
Forms!PFrmShiftToPrint!ShiftID.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
Hi Steve and thanks for anwsering,
I am not very good at explaining what I want yet, so I'll try to do a better
job. I worked out your plan on paper and I noticed that you suggest keeping
track of all the hours the employees work. We don't want to keep track of
the hours worked everyday by every employee. We only want to keep track of
the employees who take certain types of time and we have to offer the type
of time based on seniority and turn. I am going to start a new thread on
this subject because I have been chasing my tale tyring to figure out the
correct way to do that. I am saving your post because it looks like
something I can use in another database I am planning to do eventually.
I think as far as my original question about shift...Here is my "better"
question.
If we only need to use "shift" for the purpose of printing lists that only
show day shift employees or night shift employees (we only have 2 shifts)
should I put the field shift in the main employee table and use "days" or
"nights" as the data for each employee? Thinking ahead, if we do add
another shift in 5 years, it will be easier to add if I make a seperate
table and link the two. Here is what I worked out.
tblEmployee
EmployeeID (PK) AutoNumber
ShiftID (FK)
EmpLName
EmpFName
Etc.....
tblShiftWorked
ShiftWorkedID (PK) AutoNumber
EmployeeID (FK)
ShiftID (FK)
tblShift
ShiftID (PK) AutoNumber
Shift.......the fields would be Days and Nights
I'll be playing around with this because I have no idea how to get a printed
list of day shift employees or night shift employees from this type of
setup.
Linda
In our current database I have a seperate table for each type of time. For
instance....
VTOOnCall (VoluntaryTimeOffOnCall)-If we need to send someone home because
there is not enough work, the supervisor will offer this to someone working
based on 1) Seniority, 2) least amount of VTOOnCall worked already this
quarter (our quarters begin in January) I have a query set up to sort by
seniority, and a totals column of VTOOnCall hours. I also have date in
there so the totals can go back to zero at the beginning of the quarter.
MTO (Manditory Time Off)-If we need to send someone home because there is
not enough work and there is no one willing to take VTOOnCall or VTO, the
person working that day with the lowest seniority and the lowest total MTO
hours for a work quarter (Jan, Feb, Mar/Apr, May, Jun/ etc) is forced to go
home. Those hours are entered into the database and then that person is now
at the bottom of the list to go home because they have MTO hours.
Consider having these tables:
TblWorkHoursType
WorkHoursTypeID
WorkHoursType
tblHoursWorked
HoursWorkedID
EmployeeID
WorkDate
ShiftID
WorkHoursTypeID
HoursWorked