How do I limit entries into database

G

Guest

I have a db that has class registrations in it. I need to be able to limit
the number of people who can register for a class (i.e. if the teacher will
only accept 15 students, how/what do I need to do to not allow any further
registrations for that class)? I have a report the teacher can print that
totals the # of registered students, so I'm wondering if there is a way I can
deny a registration if the class is already full...hope that makes sense.
Thanks!
 
P

Pat Hartman \(MVP\)

You need to store the max number of students allowed for each class. Then
before you add a new student, use DCount() to count the number of existing
records. If it is greater than or equal to MaxAllowed, cancel the add and
reject the registration.
 

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