VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



'This code will not allow the user to enter any character data, only numbers.

by Arian Tuazon (1 Submission)
Category: Miscellaneous
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Originally Published: Wed 23rd October 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

'This code will not allow the user to enter any character data, only numbers.

Rate 'This code will not allow the user to enter any character data, only numbers.



Private Sub txt1_KeyPress(KeyAscii As Integer)
     If KeyAscii > 31 And KeyAscii < Asc("0") or KeyAscii > Asc("9") Then
          Let KeyAscii = 0
     End If
End Sub

Download this snippet    Add to My Saved Code

'This code will not allow the user to enter any character data, only numbers. Comments

No comments have been posted about 'This code will not allow the user to enter any character data, only numbers.. Why not be the first to post a comment about 'This code will not allow the user to enter any character data, only numbers..

Post your comment

Subject:
Message:
0/1000 characters