primary key for timecards and employees

J

joe

Hello

How can i get the results of each timecard entry to only appear in the employee table under the employee number which is unique.It is a one to many(one employee to many timecards) but i just want the entrys to be under the one time entry of the employee number not for each timecard and employee number to be repeated over and over again in the employee table.I have been told to create the employee number as a primary in the employee table and not to have a primary key at all in the timecard table but when i transfer all the fields to a form...i get dups not allowed and i cant enter another record on the form.What am i doing wrong??????
 
K

Ken Snell

Not clear at all what your table structure is. Let me suggest what I believe
would be a good starting point.

tblEmployees
fldEmpID (primary key)
fldEmpFirstName
fldEmpLastName
(etc.)

tblTimeCardEntries
fldTimeCardID (primary key)
fldEmpID (foreign key to tblEmployees)
fldDateTimeOfEntry

No need with this setup to have info repeating as you appear to have.
--
Ken Snell
<MS ACCESS MVP>



joe said:
Hello,

How can i get the results of each timecard entry to only appear in the
employee table under the employee number which is unique.It is a one to
many(one employee to many timecards) but i just want the entrys to be under
the one time entry of the employee number not for each timecard and employee
number to be repeated over and over again in the employee table.I have been
told to create the employee number as a primary in the employee table and
not to have a primary key at all in the timecard table but when i transfer
all the fields to a form...i get dups not allowed and i cant enter another
record on the form.What am i doing wrong??????
 
J

joe

thanks and i have tried this very same structure.Could you tell me according to this structure.....the primary keys are autonumber in one table and number in the other?Thanks
 
K

Ken Snell

Primary keys in both tables can be autonumber. The foreign key field must be
Number - Long Integer so that it matches the format of the primary key in
the parent table.

--
Ken Snell
<MS ACCESS MVP>

joe said:
thanks and i have tried this very same structure.Could you tell me
according to this structure.....the primary keys are autonumber in one table
and number in the other?Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top