Write this code in the KeyPress event of the text box which you want to accept only numeric values.
If Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) <= 57 Then
e.Handled = False
ElseIf Asc(e.KeyChar) = 46 Then
e.Handled = False
Else
e.Handled = True
End If
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment