-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
You could use the KeyDown event which fires each time a key is hit in
the control. Something like this:
Private Sub txtBox_KeyDown(KeyCode As Integer, Shift As Integer)
If (Keycode >= vbKey0 and vbKey9 <= KeyCode)
OR (Keycode >= vbKeyA and vbKeyZ <= KeyCode) Then
' Do Nothing
Else
' Not one of the permissible keys
KeyCode = 0
Beep ' Yell at the user
End If
End Sub
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBP9/Is4echKqOuFEgEQJNyQCbBwXHtmpLY4j8eS+2PkWS9Qghr2IAo LXp
I+0Uy0wmmLQgE/CsQwsr7d5Y
=4zso
-----END PGP SIGNATURE-----
Barnoit wrote:
I'm sure this is very easy, but I know very little about access. I'm
trying to add a validation rule to my textbox to only accept
alphnumeric chars. From the alpha side, I tried Like "[a-z]" , which
accepts a single char. So I tried to add an asterisk ie. Like
"[a-z]*", but that now accepts any char. How do you apply the rule to
each character entered, if you don't know the length of the input
string beforehand? Thanks in advance.