How do I run a query depending on the result of a count query?

G

Guest

I am writing a database to calculate pay for a seed treating plant.

I have a query to display all staff, the date is appended as per the date
entered into the date field of an unbound form.
The data entry clerk marks the employee present - yes/no field.
The records are then appended to the register table.

How do I prevent the data entry clerk from running the append query twice.

I have tried a count query to count the number of names in the register for
the date on the date form.
When a button on the date form is clicked the count query is run with an if
.... then statement.
If (CountOfNames = 0) then
//run append query

I am not having much success with this. Any suggestions?
 
J

Jeff Boyce

This seems like a post already asked and answered.

Try indexing the date field in the table, and require it to be unique.

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
 
G

Guest

The Register table that is being appended to has a number of employees, each
with the date and yes/no for present, therefore indexing the date field and
making it unique would not work
 
J

Jeff Boyce

And if you created a multi-field index across date & employee...?

--
Regards

Jeff Boyce
Microsoft Office/Access MVP
Microsoft IT Academy Program Mentor
 

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