Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

help with loops

$
0
0
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

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>