-
1
- #1
I have found this short code snippit to be useful to prevent the user from entering numeric data in a text field, on purpose or by accident. When the user attempts to enter a numeric key a message is delivered to the user and the entry is nullified. The cursor is returned to the exact place before the user entered the numeric key. I'm not sure if this is too elementary for you computer experts, but I think someone might find it handy.
Private Sub txtLastName_KeyPress(Key Ascii As Integer)
If IsNumeric(Chr(KeyAscii)) Then
MsgBox "Numeric data is not allowed in this field"
KeyAscii = 0
End If
End Sub
Private Sub txtLastName_KeyPress(Key Ascii As Integer)
If IsNumeric(Chr(KeyAscii)) Then
MsgBox "Numeric data is not allowed in this field"
KeyAscii = 0
End If
End Sub