Incrementing field value

Ja (:

Registered User.
Local time
Today, 09:06
Joined
Jan 9, 2007
Messages
17
Hello there, some help would be nice! Say i have a booking field. If people wanted to book a number of seats, how would i make it so that when the number of seats that was entered on the booking form was entered it would add on to the exsisting number of seats taken?

So say for film A There is 20 seats available and 4 of been booked, then someone wants to book 2 more, how do i make it so now, the number of seats taken shows up as 6 as apposed to 4?

Id like this done without VB if possible?

Thanks!
 
You are doing it wrong to start with, but VBA isn't required.

Think about this:

tblBookings
Theater, text or number as appropriate, identifies theater
Showing, date/time
Seats, number of seats booked in a given transaction
TransID, id-number of transaction, might be autonumber
other booking info goes here if needed

A summation query using SUM([SEATS]) grouped by [THEATER] and by [SHOWING] gives you the number of seats booked at any time.

A second table:

tblTheaters
Theater, same as above
MaxSeats, number

You can get a table of showings based on the same theater id and a date/time as a way of confirming that the booking relates to something that is actually showing at the intended time.

provides the feedback for you to know if you can do the booking, because you can JOIN the theater table to the summation query to see if you have room in the first place. No VBA involved here, though a couple of DSum operations might be required.

The way you were headed is not normalized and would ALWAYS give you a major headache.
 

Users who are viewing this thread

Back
Top Bottom