Primary key for timecards assigned to tables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

I am creating a time card database but i have a question in how to designate primary keys.I only have two tables, one for employee and another for timecards.It will track the hours of twenty three employees that have a employee number and i thought i could use that as a primary key in the employee table.I have seen sample databases where acct numbers or employee numbers are seen in datasheet view with a plus sign next to them and when clicked, all transactions for that acct or employee number tree out with all the related data.In mine, i cant get those results....As far as organization, it does not look good since for each day of the work week ,the datasheet view shows all entries for each employee for each day of the week.Is it my primary key designation of empId to an autonumber in timecards the problem
Thanks,Joe
 
Joe

Employees need to be uniquely identified -- and it sounds like you have an
EmployeeID.

Timecards need to be uniquely identified -- but I'm not clear on what you
are using here. You mention an "autonumber", but then mention EmployeeID.
If one employee could have more than one timecard, you can't use EmployeeID
as a unique identifier for timecards, right?!
 
Joe

You could post a brief description of your table structure, so 'group
readers could get a better idea. I've noticed twice that you are describing
working in the tables -- tables store data, forms display it. You're better
off forgetting about the little + sign in the tables and developing forms to
show your data.

Your tables might look like:

tblEmployee
EmployeeID
FName
LName
... (other employee-specific data elements)

tblTimeSheet
TimeSheetID
EmployeeID
DateOfWork (a date/time field recording the Date of the timesheet --
you don't need to record Monday, Tuesday, ..., because a query of this
DateOfWork field, using the ?WeekDay() function will give you day of week)
HoursWorked
... (other work hours-specific data elements)

So, what does your data look like (both the structure and a small example of
data might help).
 
Back
Top