Limit action query

H

Hank

I have a form based on an append query that is used to take daily work
attendance. Records are appended to a table showing who was a work on a
given day.
The problem is: the query can be run more than once per day - thus giving
more than on attenddance record for each person.

How can I limit the query to only be run once per day or limit the table to
only accept one record per employee per day?

Hope this is clear.

Thanks
Hank
 
M

MGFoster

Hank said:
I have a form based on an append query that is used to take daily work
attendance. Records are appended to a table showing who was a work on a
given day.
The problem is: the query can be run more than once per day - thus giving
more than on attenddance record for each person.

How can I limit the query to only be run once per day or limit the table to
only accept one record per employee per day?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You have to set up a unique key on the table. Usually this key is the
Primary Key. Probably the employee ID and the work date would be
acceptable. If someone tries to put in the same work date for that
employee the table will return an error saying Key Violation -
Duplicate. This assumes that the work date is only a date value not
Date and Time values.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
** Respond only to this newsgroup. I DO NOT respond to emails **

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBSdBXy4echKqOuFEgEQL1sgCg13Ahq5uOga6guaHXgwmvZCtN3FYAoKYW
9THzsXdQiF8hUKit7jtKSC3p
=pjka
-----END PGP SIGNATURE-----
 
H

Hank

Tanks for your reply.
I guess I don't fully undrstand how to set up a unique key. I do have the
primary key as the empID. I have tried changing the Unique Vaulue
properties of the query to YES, but cannot run the query at all now.
How would I set a unique key using the empID and the workdate so that an
empID can only be used once for each workday?
Thanks again
Hank
 

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