A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

primary key for timecards and employees



 
 
Thread Tools Display Modes
  #1  
Old May 29th, 2004, 12:16 AM
joe
external usenet poster
 
Posts: n/a
Default primary key for timecards and employees

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??????
  #2  
Old May 29th, 2004, 12:25 AM
Ken Snell
external usenet poster
 
Posts: n/a
Default primary key for timecards and employees

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" wrote in message
...
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??????


  #3  
Old May 29th, 2004, 03:36 AM
joe
external usenet poster
 
Posts: n/a
Default primary key for timecards and employees

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
  #4  
Old May 29th, 2004, 04:22 AM
Ken Snell
external usenet poster
 
Posts: n/a
Default primary key for timecards and employees

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" wrote in message
...
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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:17 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.