The typical datastructure is three related tables
Student >-- Attendance --< Sessions.
Many students can have many Sesssions
Many Sessions can have many Students.
An Attendance can have only one Student and one Session.
Limiting the attendances for one Session to 20 then becomes much easier.
A StudentID and a SessionID are related to each Attendance
You might find the first 5 links useful here
If you describe the tables and relationships that you have in place, we can better describe how to get what you need here. A conditional value list can probably be set up that automatically drops out sessions that are "full" if a bit of scripting is used to update a field in the Sessions table each time a student adds or drops a session.