setting limited on jobs

G

Guest

i have the following table:

---

[jobs]: job number, surname, input date, department, department date

job number: unique job number
surname: patients surname
input date: automatically added date of input
department: department the job needs to go to
department date: the date the department will do the job

---

Each department can only do a certain number of jobs each day. I need some
way of getting the database to count the number of jobs for each day, when it
hits the limit for that department on that date it needs to throw up an error
message.

example:

departments: shoe making, leather work

shoes making can only do 4 jobs per day and leather work can do only 8 jobs
per day. if i try to enter a 5th job for shoes making to be done on the 21st
december 2005 it would need to say that the department is at its maximum for
that day.

please can anyone help.
 
V

Van T. Dinh

Are you doing data entry on thee Form or directly in the DatasheetView of
the Table?

It is not possible in the DatasheetView of the Table / Query. You need a
Form to do this.

You can use the txtDepartmentDate_BeforeUpdate Event to run code using the
Domain-Aggregate function DCount() to count the number of Jobs for this
particular Dept for the date entered and then compare the count with the
capacity of the Department, possibly with a DLookUp() function statement..
 

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