Sub Textbox1_KeyPress (keyascii as integer)
If KeyAscii = 8 then exit function ' Backspace
If Not(Chr(KeyAscii) Like "[a-zA-Z]") Then keyascii = 0
End Sub
Since there isn't a question pending I'll assume you want the code to be debugged so:
Private Sub Text1_KeyPress(KeyAscii As Integer)
'You can still use the if-thens but...
Select Case KeyAscii
Case 8
Exit Sub 'notice exit sub not function
Case 65 To 91, 97 To 122 'not sure like can be used
KeyAscii = 0
End Select
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.