0

I need some type of code that does a check, to make sure the the inofmration eneted is text and no numberic data is ented. This is for a name field. I know of the isnumeric check, but is there other ways doing checks similar to that. I'm doing error catching right now and was a little confused if there was more then one way in aing this checks.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Jx_Man
0

yes, there are another way to do that. use a key ascii to handle it. so user didn't allowed to input numeric data.
try this code :

Private Sub Text1_KeyPress(KeyAscii As Integer)
    Select Case KeyAscii
        Case 65 To 90, 8 ' A-Z and backspace
        'Let these key codes pass through
        Case 97 To 122, 8 'a-z and backspace
        'Let these key codes pass through
        Case Else
        'All others get trapped
        KeyAscii = 0 ' set ascii 0 to trap others input
    End Select
End Sub

Hope this helps...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.