I am doing a Select Case and need some help with it.

bobmack37

Newcomer
Joined
Apr 22, 2003
Messages
12
I am wondering what I need to replace "except" with and "and over" with see the code to see what I mean. it works just not how I am trying to make it work. I know except has to be something else or writen a different way and I am sure and over needs to be writen dirrerent also I am just not sure how.

Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute.Click
Dim callNumber As Single
callNumber = Val(InputBox("The call number of a book:"))
Select Case callNumber
Case 100 To 199
txtOut.Text = "basement"
Case 200 To 500 and over 900
txtOut.Text = "main floor"
Case 501 To 900 except 700 To 750
txtOut.Text = "upper floor"
Case 700 To 750
txtOut.Text = "archives"
Case Else
txtOut.Text = "Call number must be between 100 and 900."
End Select
End Sub
End Class
 
Visual Basic:
Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute.Click

Dim callNumber As Single
callNumber = Val(InputBox("The call number of a book:"))
Select Case callNumber
Case 100 To 199
txtOut.Text = "basement"
Case 200 To 500, Is > 900
txtOut.Text = "main floor"
Case 501 To 699, 751 To 900
txtOut.Text = "upper floor"
Case 700 To 750
txtOut.Text = "archives"
Case Else
txtOut.Text = "Call number must be between 100 and 900."
End Select
End Sub
End Class
 
Back
Top