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.
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