Problem with "else if" and "" "" in VB.NET

1

I am setting up a small system that if the number entered in textbox3 is less than 3, a% "message will appear in% with an" 8% "message, and if it is a number between 4 and 6, it appears in textbox4 " 9%. " This part of between 4 and 6 I can not do, I tried to put:

textbox3.text > "4" and < "6"...  

But it did not work. Here is my code.

If Val(TextBox3.Text < "3") Then
        TextBox4.Text = "8%"
    ElseIf Val(TextBox3.Text > "6") Then
        TextBox4.Text = "9%"
    End If
    
asked by anonymous 28.11.2017 / 16:02

1 answer

0

This is to work if you only allow 1 digit, if you allow more than 1 it can give problem. The statement sounds wrong too, I did what was written in the question. It seems to have a logic error too, unless it has a validation I did not see.

If TextBox3.Text < "3" Then
    TextBox4.Text = "8%"
ElseIf TextBox3.Text >= "4" AndAlso TextBox3.Text <= "6" Then
    TextBox4.Text = "9%"
End If
    
28.11.2017 / 16:16