forms respond with duplicate..no record can be saved

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

Guest

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?????? I am unsure if this is a forms problem or a design problem with the primary key????
 
in a normalized database, each employee should be listed once in an employee
table. that table would be about employees, not about timecards. certainly i
can't imagine a multi-record table in a normalized database without a
primary key.
you say one employee has many timecards, which i understand (having done my
share of punching a clock). now, what do you define as a timecard? in the
"real world", usually an employee has one timecard each week, with which
he/she clocks in and out each day that he/she works that week. the next
week, the employee gets at new timecard to clock in/out on, etc, etc, etc.
do you need to track each clock in/out specific to each time card? or just
track each employee's clock in/out times by date, without reference to a
specific time card?


joe said:
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?????? I am unsure if this is a
forms problem or a design problem with the primary key????
 
Joe -

In our other thread in m.p.a.tablesdbdesign, I did not say you should not
have a primary key in timecards table. Please read my reply again.

You are not giving people enough information about how your form is set up
based on the tables. Are you using a table structure similar to what I
suggested as a starting point?

--
Ken Snell
<MS ACCESS MVP>

joe said:
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?????? I am unsure if this is a
forms problem or a design problem with the primary key????
 
i'll bow out of this thread now. if i'd seen the other thread with your post
earlier, i wouldn't have posted to this one. sure wish people would quit
abandoning threads and starting new ones within a few hours like this.
<sigh>
 
No Ken, I was not referring to you about not having the primary key.It was access helpline from the recent class i took on this matter and apparently they may have been wrong.I have tried your previous suggestion using one to one and one to many and it is frustrating to to acheive the results i am looking for.It is a simple design with one table of employees and three fields,,,,,,emp number, first name and last name.The timecards table will have hours worked, hours not worked, overtime and date.The reason i posted in the forms forum is because i thought there was something wrong with the way i put the fields from both tables into the form.All i wanted was to use the employee number as a primary key in the employee table so each transaction would appear only with their number and by clicking the plus sign next to the employee number in the table......it would show all transaction for them.Currently, in this table...you see the employee number for every entry in the forms and not consolidated under the plus sign.
 
Can you tell us how you've set up the form? If you've used a table structure
similar to what I suggested in m.p.a.tablesdbdesign newsgroup, you should be
able to display (for an employee) all timecard entries for that employee if
you use a subform for the timecard entries table's records and the main form
for a record from the employees table.


--
Ken Snell
<MS ACCESS MVP>

Joe said:
No Ken, I was not referring to you about not having the primary key.It was
access helpline from the recent class i took on this matter and apparently
they may have been wrong.I have tried your previous suggestion using one to
one and one to many and it is frustrating to to acheive the results i am
looking for.It is a simple design with one table of employees and three
fields,,,,,,emp number, first name and last name.The timecards table will
have hours worked, hours not worked, overtime and date.The reason i posted
in the forms forum is because i thought there was something wrong with the
way i put the fields from both tables into the form.All i wanted was to use
the employee number as a primary key in the employee table so each
transaction would appear only with their number and by clicking the plus
sign next to the employee number in the table......it would show all
transaction for them.Currently, in this table...you see the employee number
for every entry in the forms and not consolidated under the plus sign.
 
thanks, Ken. <smile and bow in your direction>
i usually continue tracking any thread i've posted to, to see what i can
learn from it, but i very seldom have anything to contribute that would add
additional value to any MVP's comments. :)
 
Back
Top