how do I do it?
Printable View
how do I do it?
i saw an article either on this site or VB API once about how to use the api to make a text box accept numbers only. So i think there's probably a similar thing that you can do to make it accept alphabetics only...
I'll have a look around and let you know if i find it - but at least you know that a solution is floating around out there somewhere...
[Edited by denniswrenn on 08-21-2000 at 09:33 PM]Code:Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 8 ' backspace
Case 65 To 90 'A-Z
Case 97 To 122 'a-z
Case Else
KeyAscii = 0
End Select
End Sub
Add a Case 32 to Dennis' code for the blank space:
Quote:
Code:Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 8 ' backspace
Case 65 To 90 'A-Z
Case 97 To 122 'a-z
Case 32 'blank space
Case Else
KeyAscii = 0
End Select
End Sub
I did remember to accept the space key, but I accidently deleted it for some reason :o
ok, thanks to both for your help and time, and good luck with your campain dennis
i tried without case 97 but case 65 doesn't work without for some reason