Link to home
Start Free TrialLog in
Avatar of leeann
leeann

asked on

Error handle

Since there are more than three Textboxes in my application needed the user input number from 0
to 9999, I want a function which could deal with
the input errors, and give me an example to tell
how to call the function. Thanks!
ASKER CERTIFIED SOLUTION
Avatar of marscpa
marscpa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mirrorinternetzahavnet
mirrorinternetzahavnet

I would do it even shorter:

Private Function ValInput(sInput As String) As Boolean

If Not IsNumeric(sInput) = True Then exit function
If Val(sInput) < 0 And _
                 Val(sInput) > 10000 Then Exit Function
 
ValInput = True
End Function