Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting no. of records with same Employee number 1

Status
Not open for further replies.

KenCunningham

Technical User
Mar 20, 2001
8,475
GB
Good morning folks. I have been asked to design a database for 'casual' employees, where one 'Employee Number' will be used per 10 staff employed. I don't quite see the logic behind this, but I can see that without any validation on my form it's quite possible that this limit will be exceeded in practice.

I guess my requirement would be to force a warning/stop box when an 11th entry with the same Employee Number is attempted. It's been quite a time since I used Access, so if someone has an off-the-shelf solution, so much the better. I guess we're looking along similar lines to preventing (say) library users from taking out too many books at a time, and issuing a warning if they do attempt to do so. Thanks in anticipation of any help you can give.

Some days are diamonds, some days are rocks - make sure most are the former.
 
Have a look at the DCount function.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV, will do.

Some days are diamonds, some days are rocks - make sure most are the former.
 
Back to award a star, thanks PHV. Code goes:
Code:
If DCount("[Employee]", "tblPeople", "[Employee] = '" & Me![Employee] & "'") >= 10

which increments the new Employee value if it is the same as previous ones and issues a warning if the 10 limit is reached.


Some days are diamonds, some days are rocks - make sure most are the former.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top