Results 1 to 2 of 2
  1. #1
    mithu 1992 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    2

    Exclamation MS Access password filed validation

    How to validate a MS Access password text box as criterion below?


    (i) At least one uppercase
    (ii) At least one lowercase
    (iii) At least one number
    (iv) Password length 8 - 12

    Thanks

  2. #2
    Dal Jeanis is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742

    Quick code for a test routine

    Something like this could work.
    Code:
    Function TestPass(strPass as string) As Boolean
    Dim j as Integer
    Dim lp as Integer
    Dim FoundLC As Boolean
    Dim FoundUC As Boolean
    Dim FoundNum As Boolean
    
    ' Set result to false
    testPass = False
    
    ' Test length
    lp = len(txtPass)
    if lp < 8 or lp > 12 then
       Exit Function
    end if 
    
    'test each character for each required element
    FoundLC = False
    FoundUC = False
    FoundNum = False
    For j = 1 to lp
       Select Case mid(strPass,j,1)
          Case "a" through "z"
             FoundLC = True       
          Case "A" through "Z"
             FoundUC = True       
          Case "1" through "9", "0"
             FoundNum = True       
       End Select
    Next j
    
    ' If all required elements have been found, 
    ' set true, otherwise leave false
    If FoundLC AND FoundUC AND FoundNum Then
       testPass = True
    End If
    
    End Function

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Calculated filed in Access 2007
    By fekrinejat in forum Access
    Replies: 6
    Last Post: 02-05-2013, 07:54 PM
  2. Replies: 1
    Last Post: 07-24-2012, 06:10 PM
  3. Replies: 1
    Last Post: 06-22-2012, 08:05 AM
  4. Access Password - Not encrypted
    By shexe in forum Access
    Replies: 5
    Last Post: 09-29-2010, 02:15 PM
  5. password validation
    By RycherX in forum Forms
    Replies: 1
    Last Post: 02-20-2010, 03:55 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums