I have function code here. To restrict the input in textbox only for numeric.
Public Function OnlyNumericKeys(KeyAscii As Integer, TextBox As control) As Integer
Select Case KeyAscii
Case 8, 48 To 57, 46 And InStr(TextBox, ".") = 0
Case 45 And InStr(TextBox, "-") = 0
If TextBox.SelStart > 0 Then
KeyAscii = 0
End If
Case Else
KeyAscii = 0
End Select
OnlyNumericKeys = KeyAscii
End Function
Thanks for the help of my friend (mike).
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment