Invaild quailfier

  • Thread starter Thread starter Michael Mak
  • Start date Start date
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.
 
Michael
\\\\\\\
Private Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Select Case CType(txtAwardMiles.Text, Integer)
Case 1 To 600
lblawardzone.Text = "S"
Case 601 To 1200
lblawardzone.Text = "A"
Case 1201 To 2500
lblawardzone.Text = "B"
Case 2501 To 5000
lblawardzone.Text = "C"
Case 5001 To 7500
lblawardzone.Text = "D"
Case 7501 To 10000
lblawardzone.Text = "E"
Case Is > 10001
lblawardzone.Text = "F"
End Select
End Sub
////////
Cor
 
Michael Mak said:
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.

Maybe you should read the replies to the same question from yesterday.
 
Armin Zingler said:
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.

Um...sorry, didn't read that... :-/
 
Hello,

Michael Mak said:
Im having trouble with my assignment related to Visual
Basic,

You wanted to say "Related to Visual Basic Classic". This is a VB .NET ng,
please turn to one of the VB6 ngs (microsoft.public.vb.*).

Regards,
Herfried K. Wagner
 
Back
Top