Only allow numbers AND control codes (i.e. backspace) to be entered in a text box
Only allow numbers AND control codes (i.e. backspace) to be entered in a text box
Rate Only allow numbers AND control codes (i.e. backspace) to be entered in a text box
(1(1 Vote))
Call KeyCheck(KeyAscii)
End Sub
Public Function KeyCheck(ByRef KeyAscii As Integer)
'Disallow the user to enter anything other than numbers and control codes
If KeyAscii < 48 Or KeyAscii > 57 Then 'disallow anything other than numbers
If KeyAscii = 8 Or KeyAscii = 9 Or KeyAscii = 10 Or KeyAscii = 13 Then 'allow all the control codes though...
KeyAscii = KeyAscii
Else
KeyAscii = 0
End If
End If
End Function
Only allow numbers AND control codes (i.e. backspace) to be entered in a text box Comments
No comments yet — be the first to post one!
Post a Comment