by Brandon (46 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 25th June 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Allow only numbers to be entered in a text box
Private Sub Command1_Click()
'validate data for numbers only
If Not IsNumeric(Text1) Then
MsgBox "Only numbers are allowed", vbExclamation, "Invalid Data"
Text1 = ""
Text1.SetFocus
Else
MsgBox "The data enter was valid, you may continue", vbInformation + vbOKOnly, "Valid Data"
End If
End Sub