Updating an integer in another form

hydeyho

Registered User.
Local time
Today, 05:49
Joined
Mar 1, 2007
Messages
31
I'm creating a booking system for course and I'm using the following code to reduce the places available by 1 when someone else is booked on a course:

SearchID = intCourseDetails
DoCmd.OpenForm "frmCourseDetails"
DoCmd.GoToControl "intCourseDetails"
DoCmd.FindRecord SearchID
intOccupancy = intOccupancy - 1

I've probably made a really simple mistake but it simply won't take 1 from intOccupancy. Anyone know what I'm doing wrong or a better way of doing this?
 
How does intOccupancy get set initially? right now, as the code stands, without the surrounding code, it is taking a variable which is zero and subtracting one to give negative one (-1). How are you determining how many places are currently available before setting your booking?
 
All the course details are already entered, so the search just finds the correct record and populates the fields accordingly. I've managed to get this done with a macro, doesn't seem like the best method but appears to work.
 

Users who are viewing this thread

Back
Top Bottom