Hi,
There are a large number of ways to do this, the easiest probably being to to add a data connection recieving data from the list the form is hosted on and then adding a rule in the open and save rules section to switch views:
The following is off the top of head so apologies if not totally correct.
1) Create new view, design tasks, views, create view. Flick back to the first view copy the entire form and poaste into new view. Now you to go through the text boxes etc and change them to read only on the new view. (If You have Date Pickers etc. Change them to text boxes first)
2) Create recieving data conncetion to list form is hosted on. Select ID and finish.
3) Creat Rule when form is opened. Tools\form option\open and save\Rule, click new rule, set condition to if max(@ID) = 21, than add action to switch view to the locked version.
Better still and easier is to create a new viewing saying this event is full rather than locking the form.
One thing you could do is look into the 'count' function as it would be accurate than max(@ID). The form will drop in and out of the full state view allowing students to register if someone drops out provided that form is removed from the list.
What you are doing is fun to play around with and I'm sure you'll find other more slicker ways of doing it in your exploits.
Good luck