[CODE=vb]Private Sub txtCustCode_Cha nge()
Dim str As String
Dim i As Integer
For i = 1 To Len(txtCustCode )
str = Mid(txtCustCode , i, 1)
If Not IsNumeric(str) Then
msgbox "Only Numeric values allowed"
txtCustCode.Tex t = ""
End If
Next
End Sub[/CODE]
This is my code.....so when user enters some values that are not numeric an error message is shown and the entire textbox is cleared while I want only the non-numeric text to be cleared. Is there any way to achieve this in VB6?
Dim str As String
Dim i As Integer
For i = 1 To Len(txtCustCode )
str = Mid(txtCustCode , i, 1)
If Not IsNumeric(str) Then
msgbox "Only Numeric values allowed"
txtCustCode.Tex t = ""
End If
Next
End Sub[/CODE]
This is my code.....so when user enters some values that are not numeric an error message is shown and the entire textbox is cleared while I want only the non-numeric text to be cleared. Is there any way to achieve this in VB6?
Comment