Re-type Password

daveee143

Registered User.
Local time
Today, 07:52
Joined
Apr 30, 2011
Messages
24
I'm having problem dealing with this one.

when i type the password, then after i "CLICK" the Confirm password. the password is already there which is not logically correct, because we want that when the user type the password in txt box 1 then type again the password to txtbox 2.

Here the code i've right.


Code:
Private Sub Close_Click()

    If IsNull(Me.Username) Or Me.Username = "" Then
            MsgBox "You must enter a Username.", vbOKOnly, "Required Data!"
            Me.Username.SetFocus
        Exit Sub
    End If
    If IsNull(Me.Password) Or Me.Password = "" Then
            MsgBox "You must enter a Password.", vbOKOnly, "Required Data!"
            Me.Password.SetFocus
        Exit Sub
    End If
     If IsNull(Me.Password2) Or Me.Password = "" Then
            MsgBox "You must enter a Password.", vbOKOnly, "Required Data!"
            Me.Password.SetFocus
        Exit Sub
    End If
    
    If Me.Password2.Value = Me.Password Then
        DoCmd.Close acForm, "NewUsers", acSaveNo
        DoCmd.OpenForm "Login"
        Else
        MsgBox "Please re-type password. ", vbOKOnly, "Invalid Entry!"
        Me.Password.SetFocus
    End If
End Sub
Private Sub Form_Open(Cancel As Integer)
Me.Username.SetFocus
End Sub


Private Sub Username_AfterUpdate()
Me.Password.SetFocus
End Sub
Private Sub Password_AfterUpdate()
Me.Password2.SetFocus
End Sub
 

Attachments

  • untitled.jpg
    untitled.jpg
    85 KB · Views: 171
Are you using a Table to store the User Name and Password values? If you do then I think both the password Textboxes have the same password field as control source, check and confirm.
 

Users who are viewing this thread

Back
Top Bottom