>this code dont permit to delete a single char
Well, that depends - Del works fine, as that is not interpreted as an ASCII controlcode. Backspace, however, will; not work because you asked for letters only, and backspace is not a letter
>and dont permit to use the tab for deletation....
Tab to delete? Huh? In what world. Tab is used to move between tabable controls on a form. Not to delete. And no, it won't work with this code beccasue, again, it isn't a letter, it is a control code.
To restore backspace and Tab functionality to their defaults iwe simply need to modifiy our code as follows:
Code: Select all
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 65 To 90, 97 To 122, 8, 9
KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
KeyAscii = 0