M
Michael Mak
Im having trouble with my assignment related to Visual
Basic, my problem is i've created one text box and one
label box. In my text box, it requires the user to type
in a number. Im trying to wrtie a code which can group
the number into different group represented by a letter.
Private Sub cmdCalculate_Click()
Dim txtAwardMiles As Integer
Dim lblAwardZone As Integer
lblAwardZone.Caption = Val(txtAwardMiles.Text)
Select Case Val(txtAwardMiles.Text)
Case 1 To 600
lblAwardZone.Caption = "S"
Case 601 To 1200
lblAwardZone.Caption = "A"
Case 1201 To 2500
lblAwardZone.Caption = "B"
Case 2501 To 5000
lblAwardZone.Caption = "C"
Case 5001 To 7500
lblAwardZone.Caption = "D"
Case 7501 To 10000
lblAwardZone.Caption = "E"
Case Is > 10001
lblAwardZone.Caption = "F"
End Select
End Sub
However when i run the problem and put number in it, the
windows came up and said:
Compile Error:
Invalid qualifier
Could anyone please help me, thanks a lot!
P.S I've posted the probles before and changed some of
the codes, thanks for your help, Jeremy and Mark.
But still can't get it working properly.
Basic, my problem is i've created one text box and one
label box. In my text box, it requires the user to type
in a number. Im trying to wrtie a code which can group
the number into different group represented by a letter.
Private Sub cmdCalculate_Click()
Dim txtAwardMiles As Integer
Dim lblAwardZone As Integer
lblAwardZone.Caption = Val(txtAwardMiles.Text)
Select Case Val(txtAwardMiles.Text)
Case 1 To 600
lblAwardZone.Caption = "S"
Case 601 To 1200
lblAwardZone.Caption = "A"
Case 1201 To 2500
lblAwardZone.Caption = "B"
Case 2501 To 5000
lblAwardZone.Caption = "C"
Case 5001 To 7500
lblAwardZone.Caption = "D"
Case 7501 To 10000
lblAwardZone.Caption = "E"
Case Is > 10001
lblAwardZone.Caption = "F"
End Select
End Sub
However when i run the problem and put number in it, the
windows came up and said:
Compile Error:
Invalid qualifier
Could anyone please help me, thanks a lot!
P.S I've posted the probles before and changed some of
the codes, thanks for your help, Jeremy and Mark.
But still can't get it working properly.