|
-
October 30th, 2002, 09:37 PM
#1
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?
-
October 31st, 2002, 02:48 AM
#2
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
-
October 31st, 2002, 10:33 AM
#3
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?
-
October 31st, 2002, 12:18 PM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|