|
-
October 10th, 2002, 10:02 AM
#1
Problem using "On Error" Statement...
Hi all,
On my form I have a text box(Text1) and a button(Command1), here is the code at the moment:
Private Sub Command1_Click()
On Error GoTo Err1
If Int(Text1) < 0 Then
MsgBox ("Only enter a positive number")
Else
MsgBox ("You have entered a correct digit")
End If
Err1: MsgBox ("An Error has occured")
End Sub
The reasons I have put in the error statement is to prevent the user from entering letters into the box. The problem is, if I enter a positive digit, e.g. 10 into the box, I get the expected message box appearing and then straight after I get the error box appearing??
Any info on how I can fix this? Thanks.
Mark
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
|