Limiting records

H

harleyken

I am building a student/class database and want to limit number of students
per class. Classes have unique id, and I would like to stop adding students
to a class when it reaches the classroom capacity. Is this possible in 2007?

three tables - classes available/students/classes.
classes available - text field, student capacity #, and autonumber
classes (scheduled)- class (from classes avail) and start date
students - contact info and class number (from classes scheduled)

Thanks for your time.
 
K

Klatuu

Add a StudentsRegistered field to your class table. Add 1 to it whenever a
student is registered in the class. When it is = to the student capactiy
field, stop allowing registrations. One possibility would be to use the
Before Insert event of the form to see if the class has reached capacity. If
it has, cancel the insertion and undo the form.
 
H

harleyken

sounds like a simpler solution than I was thinking. I sould be able to figure
that out. Thanks.
Ken
 

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