nhior.it@gmail.com +966534401783
July 09, 2024 - BY Admin

Validate Password Length

Code how to validate the password length




read and undertand and copy thies code use to your project if you want.



' ******************************************************

' validate the password length

' ******************************************************

Private Sub passwords_Change()

On Error GoTo Err_passwords_Change


Dim strMsg As String


Const max_chars = 10


With Me.passwords


    If Len(.Text) > max_chars Then

        strMsg = "Password exceeds the maximum characters allowed of " & max_chars & Space(20) & _

               vbCrLf & " Please correct and Try Again"

        MsgBox strMsg, vbCritical, "ateleast 10 Character Password length"

        

        .Text = Left(.Text, max_chars)

        .SelStart = max_chars

    End If


End With


[password_date] = Date


Exit_passwords_Change:

    Exit Sub


Err_passwords_Change:

    MsgBox Err.Description

    Resume Exit_passwords_Change


End Sub

0 ITEMS
$ 0