You have the master seat listing, and that never changes, nor does it need
to be modified in anyway
(unless the building is being renovated!!!).
So, assuming you assigned some seats to some people for a PARTICULAR event,
then
you an simply query the system to get all seats assigned to those people for
the particular event.
So, if seat 34 is taken, then you might have (this is air code that probably
could actually run, but
is only for instruction here).
dim strWhatSeat as string
dim rstRecs as dao.recordset
' lets assume you have alerady selected what event/show
lngEventId = 123 ' this is the event that was selected
' now, what seat?
strWhatSeat = inputbox("what seat")
strSqlWhere = "EventID = " & lngEventId & " and SeatNum = " & strWhatSeat
if dcount("*',"tblBooking",strSqlWhere) > 0 then
msgbox "sorry, that seat is booked"
end if
So, the idea, or logic here is to simply search/look at existing bookings
for the particular event, and check if the seats have been assigned.
This means your design approach never have to actually modify, or change
anything in the seats listing table. You only look at the particular event,
and check if those seats are taken in that event. This design approach means
you don't have to create "slots", or a list of records with the seat list,
but only have a master seating list that gets used over and over for each
event. Each time you book people into a particular event, you assign a seat
value, but always check/ensure that the seat is not yet sold...
It is not at clear what your table designs are now, but I think the above
ideas and concepts will help you.
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com http://www.members.shaw.ca/AlbertKallal