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
Your experience on this site will be improved by allowing cookies.