473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to get this working??

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 = txtAwardMiles.Text
Select Case txtAwardMiles.Text
Case Is = 1 < 600
lblAwardZone.Caption = "S"
Case Is = 601 < 1200
lblAwardZone.Caption = "A"
Case Is = 1201 < 2500
lblAwardZone.Caption = "B"
Case Is = 2501 < 5000
lblAwardZone.Caption = "C"
Case Is = 5001 < 7500
lblAwardZone.Caption = "D"
Case Is = 7501 < 10000
lblAwardZone.Caption = "E"
Case Is > 10001
lblAwardZone.Caption = "F"
End Select
End Sub
0-600 = S
601-1200 = A
1201-2500 = B and so on
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! :)
Nov 19 '05 #1
2 1524
Case Is = 1 < 600

should be

Case 1 to 600

Fix this for each case statement.
HTH,
Jeremy
"Michael Mak" <cf****@hotmail.com> wrote in message
news:08****************************@phx.gbl...
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 = txtAwardMiles.Text
Select Case txtAwardMiles.Text
Case Is = 1 < 600
lblAwardZone.Caption = "S"
Case Is = 601 < 1200
lblAwardZone.Caption = "A"
Case Is = 1201 < 2500
lblAwardZone.Caption = "B"
Case Is = 2501 < 5000
lblAwardZone.Caption = "C"
Case Is = 5001 < 7500
lblAwardZone.Caption = "D"
Case Is = 7501 < 10000
lblAwardZone.Caption = "E"
Case Is > 10001
lblAwardZone.Caption = "F"
End Select
End Sub
0-600 = S
601-1200 = A
1201-2500 = B and so on
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! :)


Nov 19 '05 #2
if its the val of the textbox you want you need to

Select Case val(txtawardmiles.text)

and the cases should look like this

Case 1 to 600
do something
case 601 to 1200
and so on

Mark
"Michael Mak" <cf****@hotmail.com> wrote in message
news:08****************************@phx.gbl...
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 = txtAwardMiles.Text
Select Case txtAwardMiles.Text
Case Is = 1 < 600
lblAwardZone.Caption = "S"
Case Is = 601 < 1200
lblAwardZone.Caption = "A"
Case Is = 1201 < 2500
lblAwardZone.Caption = "B"
Case Is = 2501 < 5000
lblAwardZone.Caption = "C"
Case Is = 5001 < 7500
lblAwardZone.Caption = "D"
Case Is = 7501 < 10000
lblAwardZone.Caption = "E"
Case Is > 10001
lblAwardZone.Caption = "F"
End Select
End Sub
0-600 = S
601-1200 = A
1201-2500 = B and so on
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! :)

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Martin Heuckeroth | last post by:
Hi We are working on a webservice application and are having some problems with the cookies and/or sessions. We have them working on our intranet but then its not working on the internet. We...
5
by: tshad | last post by:
I have been working with setting my drop boxes to allow double clicking to select an item. It worked fine until I made some changes. I then stripped the page down to the bare essentials to find...
8
by: jojobar | last post by:
Okay, I am trying to do is to test the webresource in 2.0 1. I created a new project with assembly name (and default assembly name) "Office". 2. I added the following to the AssemblyInfo.cs...
2
by: Don | last post by:
I'm having problems with intellisense, autocomplete, etc. suddenly not working in certain classes of a project I'm working on. All the options are set, and it all works fine for most classes, but...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.