by priya (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 4th March 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)
To make a textbox to enter numeric value only
Private sub text1_keypress(KeyAscii As Integer)
if KeyAscii >= vbKey0 And KeyAscii <= vbKey9 Or KeyAscii = 8 Then
Exit Sub
Else
KeyAscii = 0
MsgBox " Only Numeric Value ", vbExclamation, "Number"
End If
End sub