login and password field in access form

baroom

Registered User.
Local time
Today, 11:08
Joined
May 29, 2009
Messages
19
hello every body

my user and password fields in ms access accepts both lower and upper case charecters which i dont want. if the password and user id is entered in lower case then only it should do correct things other wise iof entered in upper case then it should give me an message unvalid user.

please help me.

thanks in advance
baroom
 
Public Function txtUserIDAsciiKeysToAllow(KeyAscii As Integer)
Select Case KeyAscii 'Allows users to use ONLY integers 0-9 and all capital letters as well as the backspace, except for vowels
Case 48 To 57 'integers
Case 97 To 122 'lowercase letters
Case vbKeyBack 'Backspace
Case Else
KeyAscii = 0 'Sets Ascii value to Null, disallowing the use of the any keys that are not listed in the Case section of the function
Exit Function
End Select
End Function

You can add an error message after the KeyAscii = 0 line that sends an error message saying that you have to enter it in in lowercase letter. This actually prevents the user from using uppercase letters.

*EDIT* You can name the function whatever you want. I simply have it named that way becuase I was dealing with a textbox for User ID's. You can also take out the integers line if you don't want to allow numbers as well.

Hope this helps.
 
Last edited:
There is also an API for testing the caps lock key and you can ballon the control to say saps lock off/on.

David
 
Thanks a lot it is working fine
best regards.
 

Users who are viewing this thread

Back
Top Bottom