I created a small database with a user login form, along with a password reset form. Running it in my sandbox as an accdr file, the password value resets just fine, but on my test machine with the Access 2010 runtime installed, the password reset form doesn't reset the password. I will try to describe the state of things as of this point.
1. The LoginF presents with a combo box for the user to choose their name, and a text box to enter their password. The code below is on the After Update of the password text box.
2. The password reset form has two text boxes for the new password and to re-enter the same, as well as a command button with this code.
As I say, this works as an accdr file, but not in the actual runtime environment. Any assistance is appreciated.
1. The LoginF presents with a combo box for the user to choose their name, and a text box to enter their password. The code below is on the After Update of the password text box.
Code:
Private Sub txtPassword_AfterUpdate()
'Check if user has been chosen
If IsNull(Me.cboUser) Then
MsgBox "Please Select User Initials", vbInformation, "Warning"
Me.cboUser.SetFocus
End If
'compare cboUser column 2 to entry in txtPassword
If Me.txtPassword = Me.cboUser.Column(2) Then
Me.Visible = False
varCorrectPassword = True
Else
MsgBox "Password Incorrect", vbInformation, "Warning"
Me.txtPassword = Null
Me.txtPassword.SetFocus
End If
'Check Access Level and open navigation form
If varCorrectPassword = True Then
'Admin Form
DoCmd.OpenForm "MainNav"
End Sub
Code:
Private Sub cmdResetPassword_Click()
If Me.Password = Me.PasswordTest And Len(Me.Password) & "" > 0 Then
DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close
DoCmd.OpenForm "LoginF"
Else
MsgBox "Passwords do not match"
Me.Password = Null
Me.PasswordTest = Null
Me.Password.SetFocus
End If
End Sub
As I say, this works as an accdr file, but not in the actual runtime environment. Any assistance is appreciated.