D
David Pick
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
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