J
Jak
Guest
Hi there,
I have alittle problem and I thought it would be quite simple, obviusly 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
I have alittle problem and I thought it would be quite simple, obviusly 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