VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Simple code to insure only numbers are entered into a text box.

by Mike Parker (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 9th January 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Simple code to insure only numbers are entered into a text box.

Rate Simple code to insure only numbers are entered into a text box.



'When the user presses a key, check to insure the KeyAscii value is:
'  Between  48 - Ascii 0
'           57 - Ascii 9
   
   If KeyAscii < 48 Or KeyAscii > 57 Then
      KeyAscii = 0  '0 is Ascii Null
   End If

End Sub

Download this snippet    Add to My Saved Code

Simple code to insure only numbers are entered into a text box. Comments

No comments have been posted about Simple code to insure only numbers are entered into a text box.. Why not be the first to post a comment about Simple code to insure only numbers are entered into a text box..

Post your comment

Subject:
Message:
0/1000 characters