How do I limit number of Rows?

  • Thread starter Thread starter Jak
  • Start date Start date
J

Jak

Guest
Hi there,

I have a little problem and I thought it would be quite simple, obviously I was wrong. I searched as many forums as I could and found many other interesting stuff.

The problem which I have is, I have two tables one called modules and the other called students
The module table has an attribute called "maxstudents". This records the maximum spaces available for that module.i.e 10.

I want a code which shall count the number of ROWS of students who have already enrolled onto a particular module and ONLY allow them to be enrolled if the number of students including them is less than the "maxstudents" value. If however the number is greater, then a msg should appear and the entry should NOT be allowed. Basically I want some way to limit the number of rows of data to be entered into a table. Ps. Can all this be done using the click of a button i.e "Add Student." I think this has something to do with COUNT OR DCOUNT. SOME OF THE SQL STUFF I PUT IN KEEPS ON PUTTING UP SYNTAX ERROR, MAYBE I PUT IT IN THE WRONG PLACES OR SOMETHING

Many thanks in advance.
Jak
 
Jak said:
Hi there,

I have a little problem and I thought it would be quite simple, obviously I was wrong. I searched as many forums as I could and found many other interesting stuff.

The problem which I have is, I have two tables one called modules and the other called students
The module table has an attribute called "maxstudents". This records the maximum spaces available for that module.i.e 10.

I want a code which shall count the number of ROWS of students who have already enrolled onto a particular module and ONLY allow them to be enrolled if the number of students including them is less than the "maxstudents" value. If however the number is greater, then a msg should appear and the entry should NOT be allowed. Basically I want some way to limit the number of rows of data to be entered into a table. Ps. Can all this be done using the click of a button i.e "Add Student." I think this has something to do with COUNT OR DCOUNT. SOME OF THE SQL STUFF I PUT IN KEEPS ON PUTTING UP SYNTAX ERROR, MAYBE I PUT IT IN THE WRONG PLACES OR SOMETHING

Many thanks in advance.
Jak

Please do not multiple post it is most confusing and exceedingly bad manners. Read the forum facts and Use the search facility.
I have posted a brief reply to your other post to put you on the right track.
 

Users who are viewing this thread

Back
Top Bottom