New users to my db are assigned a default password ("password") but I want them to change this at first login and update the record password field in the table.
I'm assuming I would need to use a recordset? However I've never worked with recordsets so I'm unsure where to start so I'd be grateful for some help.
The current code for the on load event of the form is below and the form field the user would enter the new password is newPwdtxt
I'm assuming I would need to use a recordset? However I've never worked with recordsets so I'm unsure where to start so I'd be grateful for some help.
The current code for the on load event of the form is below and the form field the user would enter the new password is newPwdtxt
Code:
Private Sub LoginBtn_Click()
'Check to see if data is entered into the UserName combo box
If IsNull(Me.TxtUsername) Or Me.TxtUsername = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.TxtUsername.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.TxtPassword) Or Me.TxtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.TxtPassword.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.TxtPassword.Value = DLookup("strEmpPassword", "tblUsers", _
"[1ngEmpID]=" & Me.TxtUsername.Value) Then
lngMyEmpID = Me.TxtUsername.Value
'Close logon form and open splash screen
DoCmd.Close acForm, "Login", acSaveNo
DoCmd.OpenForm "Navigation Form"
Else
MsgBox "Invalid Password. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.TxtPassword.SetFocus
Me.TxtPassword = Null
End If
End Sub