Question show all records from one table and link to new records

niak32

Registered User.
Local time
Tomorrow, 07:07
Joined
Nov 1, 2008
Messages
28
Hi again, I am boggled by another problem with a staff table and a related table for staff hours.

I have 2 tables, tbl_Staff and tbl_Staff_hours, they are related by StaffID which is just a number (their proper staff number, no autonumber)

What I would like to do is display all staff and next to their name, have the fields from tbl_Staff_hours ready to accept data, so the whole things looks like a data grid.

If i make a new record for all the staff each day in tbl_Staff_Hours, that would do it, but it is an awful waste of records as staff don't always work every day.

basics of the tables are below:
--------------------
tbl_Staff
StaffNo
FirstName
LastName
OrderID - preset number to split staff into their groups by order
--------------------
tbl_Staff_Hours
StaffHoursID Auto
SDate = Date()
StaffNo
SignOn
MealStart
MealFinish
SignOff
--------------------
There are around 50ish staff ordered by OrderID, that's the easy part, but getting the records to return for each of them so i can add, edit their hours, hard part.

Please lend me some ideas on how to do this as it has been plaguing me for a while now.

Thanks
 
dont confuse data presentation (ie - the form display) with data representation (ie the storage)

assuming you only want to input one week at a time, then you could

a) have a temporary table with employeeid and employee hours
b) clear this
c) append all the employees (or all the ones required), so that the hours are all nil
d) display a form based on the temporary table and input the hours into this form
e) append the data for the temp table into your "real" staff hours table

job done
 
wow, I think with that reply I can understand how much I have left to learn.

I think I can grasp the method here, basicly just populate a copy of my tbl_Staff_Hours with all the staff, then update the real table as the records are modified?

Staff hours will be done day by day along with lunch and one or 2 other things, some staff will have more than one shift per day.

I will have a play and see if I can figure this out with out asking for too much help. Hopefully not getting too stuck in the process, Thanks gemma-the-husky.
 

Users who are viewing this thread

Back
Top Bottom