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