Limiting records

  • Thread starter Thread starter harleyken
  • Start date Start date
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.
 
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.
 
sounds like a simpler solution than I was thinking. I sould be able to figure
that out. Thanks.
Ken
 
Back
Top