Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Problem with Select Case in VB.net 2003
Public Sub GetTable()
Select Case cboMotorTable.Text
Case "Private Cars"
Select Case txtValue.Text
Case 0 To 100000
strRateTable = "Private_15000"
Case 100001 To 200000
strRateTable = "Private_100000"
Case 200001 To 300000
strRateTable = "Private_200000"
Case Is > 300000
strRateTable = "Private_300000"
In the above snippet if the value in txt.Value.Text is either 0 or 100000 then strRateTable = Private_15000. If it is any other number between 1 and 99999 then strRateTable is Private_100000. The rest of the case statements work fine it is only the first one that does not behave correctly. I have also tried changing the first one to
Case is <100000 which also does not work.
Can anyone help me with this problem. By the way the code works fine in VBA under Access 2003.
0 · ·