Hello, I am new to this group.
I am having a real issue with creating this Password Change function.
I have a table called "tblUser" which contains 5 columns. "UserID", "UserName", "Password", "UserAccess", and "UserEmail".
The Form "LOGIN_FORM", has 4 fields. "cboUser", "txtConfirmPassword", "pwFirst", and "pwSecond"
Below is the code I have so far. but, whenever I execute this, I get error message: "Run-Time-Error '3061' Too few parameters. Expected 1."
Private Sub Update_Click()
Dim s As String
If Me.txtConfirmPassword <> Me.cboUser.Column(2) Then
MsgBox "Password entered does not match old password"
Exit Sub
End If
If Me.pwFirst = Me.pwSecond And Len(Me.pwFirst) & "" > 0 Then
s = "UPDATE tblUser SET Password = '" & Me.pwSecond & "' WHERE UserID = " & Me.cboUser
CurrentDb.Execute s, dbFailOnError
MsgBox "Password Changed!"
'DoCmd.OpenForm "Home"
'DoCmd.Close acForm, Me.Name
Else
MsgBox "New Password entries do not match. Re-enter ." _
& vbCrLf & "and please try again.", vbCritical, _
"Re-enter both Passwords."
End If
End Sub
I have to have this functional on Monday Morning, so if anyone can help, I would be greatly appreciative!!
I am having a real issue with creating this Password Change function.
I have a table called "tblUser" which contains 5 columns. "UserID", "UserName", "Password", "UserAccess", and "UserEmail".
The Form "LOGIN_FORM", has 4 fields. "cboUser", "txtConfirmPassword", "pwFirst", and "pwSecond"
Below is the code I have so far. but, whenever I execute this, I get error message: "Run-Time-Error '3061' Too few parameters. Expected 1."
Private Sub Update_Click()
Dim s As String
If Me.txtConfirmPassword <> Me.cboUser.Column(2) Then
MsgBox "Password entered does not match old password"
Exit Sub
End If
If Me.pwFirst = Me.pwSecond And Len(Me.pwFirst) & "" > 0 Then
s = "UPDATE tblUser SET Password = '" & Me.pwSecond & "' WHERE UserID = " & Me.cboUser
CurrentDb.Execute s, dbFailOnError
MsgBox "Password Changed!"
'DoCmd.OpenForm "Home"
'DoCmd.Close acForm, Me.Name
Else
MsgBox "New Password entries do not match. Re-enter ." _
& vbCrLf & "and please try again.", vbCritical, _
"Re-enter both Passwords."
End If
End Sub
I have to have this functional on Monday Morning, so if anyone can help, I would be greatly appreciative!!