Mass amounts of buttons
Just change the colour of a 'temporarily' selected seat(s)/label(s) to say
amber. When the booking is confirmed/cancelled change to booked/available
colour.
I haven't followed your code but there's no point to maintain an
'availability or 'booked' array in in each of your 700 class's, would need
to update changes in one to all the other 699. Maintain as Public in a
normal module, or in another 'single' class that stores all global
properties.
Did the example I posted over a week ago answer your issue at that time.
Regards,
Peter
"David Pick" wrote in message
oups.com...
Now that I have everything else working I wanted to have seats that
were selected and then ordered change from blue/green to red. To do
this I decided I would try and store there id to an array called
selectedseats() inside of the class but I couldn't get the counter to
work right. Here's my code, any ideas? Thanks.
Public WithEvents lab As MSForms.Label
Public rSeat As Range
Public sRef
Public id As Long
Public rw As Long, col As Long
Public sSeatNo As String
Public z As Integer
Private Sub lab_MouseDown(ByVal Button As Integer, ByVal Shift As
Integer, ByVal X As Single, ByVal Y As Single)
Dim s As String
Dim v, b, d
Dim sprice, aprice
Dim r, c, f
sprice = 5
aprice = 10
Dim selectedseats()
'ReDim selectedseats(30)
d = d + 1
If Button = 2 Then
v = rSeat.Value
'MsgBox (sAddr(rw, col).Value)
If Len(v) Then
lab.BackColor = RGB(210, 210, 210)
If MsgBox("Un-book seat " & lab.Caption, vbYesNo) = vbYes Then
rSeat.Value = ""
v = rSeat.Value
End If
Else
'v = v + 1
rSeat.Value = 1
End If
'MsgBox id & vbCr & rSeat.Address & vbCr & sRef
lab.BackColor = IIf(Len(rSeat.Value), vbGreen, RGB(210, 210, 210))
End If
If Button = 1 Then
v = rSeat.Value
If Len(v) Then
lab.BackColor = RGB(210, 210, 210)
If MsgBox("Un-book seat " & lab.Caption, vbYesNo) = vbYes Then
rSeat.Value = ""
v = rSeat.Value
End If
Else
'v = v + 1
rSeat.Value = 2
End If
'MsgBox id & vbCr & rSeat.Address & vbCr & sRef
lab.BackColor = IIf(Len(rSeat.Value), vbBlue, RGB(210, 210, 210))
End If
ReDim Preserve selectedseats(30)
selectedseats(d) = id
For f = 1 To 3
MsgBox (selectedseats(f))
Next
MsgBox (d)
End Sub
-David
|