Trust your teacher is impressed enough to mark a higher grade next time!
Actually thats what I did for multiple seats. I switched to a MouseDown
event and after every seat was clicked I put a 1 into the corresponding
cell. Then when a button was pressed I ran a loop to see which cells
had a 1 in them and inputed a user given name to those cells.
I wouldn't change cells at this stage, redim preserve an array to store
temporarily selected seats, also at same time change colour. Add another
button to the form to press to 'book' these seats(s) or cancel. Update.
To cater for irregular sheet rows work out how to put labels on the form in
a logical layout perhaps include aisles. Instead of storing the ref's to the
class's in a 2-D array you could store them in a collection.
'in a normal module
Public gColSeats as collection
in the form's initialize event
dim cls as Class1
set gColSeats = new collection
in the loop
set cls = new Class1
(declare further properties such a variable for the Seat-ref in the class
module, eg Public sRef as string).
add all the properties to the cls ref as before, particularly the label but
other things such as seat-ref, eg
cls.sRef = "T20"
also in the loop add a reference to the class to the collection -
gColSeats.additem cls, seat-Ref
From now on you can refer to items in the collection as
colSeats(n).lab ' n being the index in the collection, or by Key -
colSeats("T20").lab
In the form's unload event
set colSeats = Nothing
I've been messing around with this, switch to different theatre events on
the same form, add & store booking references, multiple bookings, seat
pricing, etc. It has potential !
Regards,
Peter T