Constants

MS_Access_Amature

Registered User.
Local time
Today, 00:28
Joined
Nov 10, 2010
Messages
56
Private Sub MyZipCode_KeyPress (KeyAscii As Integer)
If KeyAscii >= vbKeyA And KeyAscii <= vbKeyZ Then
KeyAscii = 0
End If
End Sub


This only works for upper case letters. How can I make it case insensitive??
Thanks in advance.
 
This should work:

Private Sub MyZipCode_KeyPress (KeyAscii As Integer)
If KeyAscii >= vbKeyA And KeyAscii <= Asc("z") Then
KeyAscii = 0
End If
End Sub
 

Users who are viewing this thread

Back
Top Bottom