VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Restrict the Entry of Textbox data to Numeric Fields.

by Gulzar (3 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 15th March 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Restrict the Entry of Textbox data to Numeric Fields.

API Declarations


Useful Code
Paste the Code in the Text Box's Key Press Event.
It check for the Key which is pressed if it 0 to 9 it allows the Entry others not Allowed. Its also allows the Back space to delete text backwards if there is some mistake.

Rate Restrict the Entry of Textbox data to Numeric Fields.



If KeyAscii < 48 Or KeyAscii > 57 Then
    If KeyAscii <> 8 And KeyAscii <> 13 Then
        KeyAscii = 0
    End If
End If
End Sub

Download this snippet    Add to My Saved Code

Restrict the Entry of Textbox data to Numeric Fields. Comments

No comments have been posted about Restrict the Entry of Textbox data to Numeric Fields.. Why not be the first to post a comment about Restrict the Entry of Textbox data to Numeric Fields..

Post your comment

Subject:
Message:
0/1000 characters