-
I have a program where I ask for certain information that needs to be a #.
But I have some idiots who use it who seem to want to put periods or commas or other stupid things and it causes a run time error I know I can capture the run time error, but is there a way to make sure that what the person enters in a text box is simply a #?
and then I would want to prompt them to only enter a #.
Thanks.
Nick.
-
What about putting the following code in the Change() event (assuming the TextBox is called sleName):
Code:
If IsNumeric(sleName.Text) <> True Then
MsgBox ("Error")
sleName.Text = Left(sleName.Text, Len(sleName.Text) - 1)
sleName.SelStart = Len(sleName.Text)
End If
-
<?>
the maskedit box control was built for such cases.