|
-
Aug 21st, 2000, 08:18 PM
#1
Thread Starter
Frenzied Member
NXSupport - Your one-stop source for computer help
-
Aug 21st, 2000, 08:26 PM
#2
Addicted Member
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...
-
Aug 21st, 2000, 08:29 PM
#3
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
[Edited by denniswrenn on 08-21-2000 at 09:33 PM]
-
Aug 21st, 2000, 09:00 PM
#4
Add a Case 32 to Dennis' code for the blank space:
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
"It's cold gin time again ..."
Check out my website here.
-
Aug 21st, 2000, 09:07 PM
#5
Oops!
I did remember to accept the space key, but I accidently deleted it for some reason
-
Aug 21st, 2000, 09:18 PM
#6
Thread Starter
Frenzied Member
ok, thanks to both for your help and time, and good luck with your campain dennis
NXSupport - Your one-stop source for computer help
-
Feb 12th, 2024, 06:44 PM
#7
Banned
Re: only allow letters and space and backspace into text box
i tried without case 97 but case 65 doesn't work without for some reason
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|