Sample timecard design

J

Joe

Hello All,

I just took my first Access class and i am trying to
design a very simple database for about 20 employees.They
each have an employee number but yet i can not assign that
as a primary key.I know it will just require two
tables,one for employees and another for timecards.Does
anyone have an answer or a timecard template i could study
to perfect this database?
Thanks in advance
 
R

Rose

You should be able to assign the employee ID as a primary
key, as they should be unique in the employees table. But
it's no big deal if you don't - just add an autonumber
column if you don't want to use the ID.
The employee ID *won't* be unique in the timecard table
since employees will have multiple timecards. Again, use an
autonumber, or create a number that will mean something for
a timecard...the initials and date, maybe.

The employee table will just be for their information,
which probably only you will update. The general public
will have access to the form you create for the timecard
table. Be sure to set up security so that records can only
be entered, not viewed or deleted (so that people can't
look at other people's timecards).

You'll probably build a query that will pull together
timecard information along with employee information for a
payroll report? What happens to the data once you've
created the 2 tables and the form? Will you need to figure
out payroll deductions, or calculate tax, or anything
having to do with checks?
 
R

Rick B

Not sure about a template, but we will be glad to help you through it. You
are correct, you will need a table for the employee data and a second table
for each time card entry. I would have a date, time, employee number, and a
type (start work, out to lunch, back from lunch, stop work, etc.)

The key for your employee should be the employee number and it should be
indexed and not allow duplicates. You say that it won't let you set that as
the key? Why not?

The time card table would need a multiple key of employee number, date,
time. For simplicity you could add an autonumber field as the key so each
record would have a unique identifier.

Rick B


Hello All,

I just took my first Access class and i am trying to
design a very simple database for about 20 employees.They
each have an employee number but yet i can not assign that
as a primary key.I know it will just require two
tables,one for employees and another for timecards.Does
anyone have an answer or a timecard template i could study
to perfect this database?
Thanks in advance
 
J

joe

thanks

i tried setting the empID as primary in the employee table using the look-up wizard(to automate the entry in the forms section) but i get the error of duplicate entry and that i need to change the index to allow dups.Doing that will not allow me to assign the empId as primary.The forms entry just halts and will not save the record.I know this is simple since i set the TimeCardID to autonumber for primary in the timecard table and it half way works.It is frustrating since i am sure there is a way.......any advise to get over the primary key?
thanks
 
J

joe

thanks rose

i just responded to rick about the primary key issue and i really want to pursue this to get it right.So far i have gotten different results with one to one and one to many relationships using autonumber for both EmpID and TimeCardID within the respective tables.It is just a simple table design with emp number,last name for one table and date with hours worked and not worked for the timecard table...very basic to track if employees are working what days and how many hours.Your reference to prevent editing is now on my mind as well and so far i have practiced hiding tables and the window with preset forms as a default startup.Any advice on this simple matter would help me sleep at night
Thanks alot.
 
R

Rick B

I would guess that you have tow or more records in your table where the key
is already a duplicate. You might build a brand new table with the design
that you wnat and then copy and paste the records from your original table
into it.

Rick B


thanks ,

i tried setting the empID as primary in the employee table using the look-up
wizard(to automate the entry in the forms section) but i get the error of
duplicate entry and that i need to change the index to allow dups.Doing that
will not allow me to assign the empId as primary.The forms entry just halts
and will not save the record.I know this is simple since i set the
TimeCardID to autonumber for primary in the timecard table and it half way
works.It is frustrating since i am sure there is a way.......any advise to
get over the primary key??
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