Stuck on problem - Adjusting count when record is edited
Hello,
I'm a newbie at scripting and am working on a database to accept registrations for classes. The database allows the students to sign up for a number of classes. Each class has multiple sessions and the students choose one session. The seats are limited for each session. When no seats are available the students will be prevented from registering for that session. I have successfully written code with help of examples in the marketplace and forums to track the number of seats available for a session. I was able to create code to update the seats when a student withdraws from all the classes. My problem is that I am stuck at figuring out how to update the count of seats available when the students edit/update their registration.
I seem to have been able to solve subtracting a seat when the student switches from one class to another with the edit feature. For example, Student 1 signed up for the Administrative class on Aug. 4th but now switches to the Sept. 4th session. The code will subtract 1 seat away from the seats available for the Admin class on Sept. 4th on edit. However, I cannot figure out how to add 1 seat to the Aug. 4th class.
Any advice is appreciated. I made the application available to the public at https://creator.zoho.com/dulawlibrary/copy-of-class-registration.