hi everyone i have just started programming in college and wondering why this loop is not working.
the expecting outcome is if the error is true than clear the textbox and retype the value
Do While booleans = True
If ComboBox1.Text = "m" Then
If txtLenght.Text = "" Then
MsgBox("Length cannot be left blank")
booleans = False
txtLenght.Clear()
ElseIf txtLenght.Text <= 2 Then
MsgBox("Enter a length value greater than 2")
booleans = False
txtLenght.Clear()
End If
Else
If txtLenght.Text <= 200 Then
MsgBox("Enter a length value greater than 200")
booleans = False
txtLenght.Clear()
End If
booleans = True
End If
Loop
lenght = txtLenght.Text
width = txtWidth.Text
the problem is that it goes to the next selection instead of looping back
please help
the expecting outcome is if the error is true than clear the textbox and retype the value
Do While booleans = True
If ComboBox1.Text = "m" Then
If txtLenght.Text = "" Then
MsgBox("Length cannot be left blank")
booleans = False
txtLenght.Clear()
ElseIf txtLenght.Text <= 2 Then
MsgBox("Enter a length value greater than 2")
booleans = False
txtLenght.Clear()
End If
Else
If txtLenght.Text <= 200 Then
MsgBox("Enter a length value greater than 200")
booleans = False
txtLenght.Clear()
End If
booleans = True
End If
Loop
lenght = txtLenght.Text
width = txtWidth.Text
the problem is that it goes to the next selection instead of looping back
please help