AnsweredAssumed Answered

Help With A Calculation

Question asked by MusicCampMinion on Mar 6, 2013
Latest reply on Mar 7, 2013 by philmodjunk

Title

Help With A Calculation

Post

     This is my first time posting to the forum but i have been getting help here for years - so thank you in advance for all of your knowledge.

     I have a database which manages all aspects of a summer camp - from enrollment, to scholarships, to housing requirements, to class scheduling.  We have a total of 15 differents camps, and campers can attend more then one camp.  Each camper gets a personalized schedule of their classes which is created based on a number of factors, including which camp it is, what instrument they play (it's a music camp), how they perform at their audition, and some preference requests which they are allowed to submit.

     I have been using Filemaker for what seems like forever, but everything i know is self-taught or through books (and these forums).  My script and caluculation writing is novice at best, but so far I have been able to cobble together what I need to make the database work pretty well.  Of course, I'm always trying to improve it - and I'm stuck on a task.

     My problem is with the scheduling of a particular course.  We off an elective class where the campers send us their requests for what class they prefer, and we fill those classes on a first-come/first-serve basis.  Each class is attached to a particular camps, and has a different enrollment cap.  Right now, I have a count field which returns the current numer of campers currently placed into that class, and we use that to manually keep track of when we're hitting the cap; but I would like to  be able to run a script which prevents the user from commiting a choice for a class that has reached it's cap.

     The user is viewing this elective choice from a layout based on a table occurance called:  SCHEDULING_CAMPERS with a portal to the table occurance:  SCHEDULING_ENROLLMENTS which contains a field "ElectiveAM".  In the field ElectiveAM,  the user selects the class from a value list that populates choices from an index table called INDEX_ELECTIVES realtive to the camp they are enrolled in.  Each class record in the Index_Electives has a unique ID, and has a field which contains the enrollment cap value.  When a class is selected, the ID number  is recorded in the ElectiveAM field, and this field is ultimately used in a scheduling script which puts it into the campers schedule in the right calss period based on other factors.

     So, to make short story long, is there anything I can do to have the count of campers currently enrolled in the selected class compared with the enrollment cap for that class, and if the value is > the cap, return a custom dialog that says "This class is currently full".

     I hope I have explained this well enough.  HELP!  My brain hurts from trying to figure it out on my own.  Thank you so much!

Outcomes