I 've made a password field with Input Mask 'Password'.
But I want to be allowed the input of only letters and numbers.
How can I add this feature?
I 've made a password field with Input Mask 'Password'.
But I want to be allowed the input of only letters and numbers.
How can I add this feature?
With VBA code that checks each character in the password string.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
This has worked for me, where TargetField is the actual name of the Textbox. I just tested it and it works with the Password Input Mask in use:
Code:Private Sub TargetField_KeyDown(KeyCode As Integer, Shift As Integer) Select Case KeyCode Case 48, 49, 50, 51, 52, 53, 54, 55, 56, 57 Case 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80 Case 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 96, 97, 98, 99, 100, 101 Case 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114 Case 115, 116, 117, 118, 119, 120, 121, 122 Case vbKeyDelete, vbKeyBack, vbKeyReturn, vbKeyRight, vbKeyLeft, vbKeySpace, vbKeyEscape Case vbKeyHome, vbKeyEnd, vbKeyTab KeyCode = KeyCode Case 16 'Prevents use of ! @ # $ % ^ & * ( ) _ + MsgBox "<Shift Key> Use Is Not Allowed!" KeyCode = 0 Case Else KeyCode = 0 End Select End Sub
The only caveat is that as written, it does not allow capital Alpha characters to be entered; I've simply never found the need for that level of security in an Access database.
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007