-
error checking
ok i have the following line of code
Do While intBase < 2 Or intBase > 9
MsgBox("Error, Try Again")
intBase = txtBase.Text
Loop
i can seem to get the program to pause and let the user enter another set of data. can anyone help me out with my problem?
-
Well your code might work if you find a user that i fast enough to change the value of the textbox before the loop gets back to that msgbox. :)
Just kidding.
Is it possible for you to code this on any Event? For example the Changed event or the Validating event?
/Leyan
-
i just want the user to enter the new data. I just dont know how to do that. To get the program to actually let the user enter the data and pause. Any suggestions?
-
I'm not sure about what you mean, but if you use a code similar to the one below you will prompt the user when the textbox gets validated.
Code:
Private Sub TextBox1_Validating(ByVal sender As Object, _
ByVal e As System.ComponentModel.CancelEventArgs) Handles TextBox1.Validating
If IsNumeric(TextBox1.Text) Then
If CInt(TextBox1.Text) < 2 Or CInt(TextBox1.Text) > 9 Then
MsgBox("Eyyy, wrong number!")
End If
End If
End Sub
/Leyan