Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display a Warning Message Box when Course Is Full

Status
Not open for further replies.

djs45uk

Technical User
Nov 7, 2004
103
GB
Hello

I have a form that looks like this:


You'll see that there are 3 subforms on it (a list of students, a list of choices they can pick from, a summary of how many students have picked each course).

Here's what I'm having trouble with:

When the user clicks on one of the options in the 'Final One' list, I need it to check how many students are already on this course. If the course is already full, I'd like the form to display a message box to warn the user that the course is full.

It may help you to know that each activity does have a unique identifier (activityID) although the form doesn't show it. The list on the right is generated by a query which counts how many students are enrolled on the activities.

I'd be really grateful if anyone can help me.

Many thanks

Daniel
 
Hi

Using the .recordsetclone property may help you here

If we assume the Subform control with the list of students on the course is called frmStudentsOnCourse, and the main form is called frmMain then code like

if frmMain.FORM.frmStudentsOnCourse.Recordsetclone.recordcount >= iLimit then
msgbox "....blah"
end if

where iLimit is the number od students alowed on the course

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top