G
Guest
I've got a form that only my managers have access to (suposedly). The form
displays a record for each of our guys in our department. Each of our guys
can login and update their own record using another form with limited
capabilities. I want my managers to click a button that will reset the
password back to the default password (date of birth) for the guys record of
whom he's looking at. Here's my code:
Dim intReponse as integer
intResponse = MsgBox("Are you sure you wish to reset this FSR's password?",
vbYesNo, "Reset Password?")
If intResponse = vbYes Then
If sResetPassword(Me.Username, Me.DOB) = True Then
MsgBox "FSR's password has been reset to the default.",
vbOKOnly, "Reset Password"
Else
MsgBox "Unable to reset password. " & Err.Number & ": " &
Err.Description
End If
Else
MsgBox "Action has been canceled", vbInformation, "Cancel Changes"
Exit Sub
End If
___________________________________________________________________
Public Function sResetPassword(ByVal strUser As String, Optional varPwd As
Variant) As Integer
On Error GoTo Err_Golldarnit
Dim ws As Workspace
Set ws = DBEngine.Workspaces(0)
ws.Users.Refresh
ws.Groups("users").Users(strUser).NewPassword varPwd
sResetPassword = True
Err_Golldarnit:
MsgBox "Something went wrong" & Err.Description
Exit Sub
____________________________________________________________________
Access seems to be getting stuck on this string:
ws.Groups("users").Users(strUser).NewPassword varPwd
When I try to Compile it highlights the .NewPassword part and says, "Compile
Error. Argument not Optional"
displays a record for each of our guys in our department. Each of our guys
can login and update their own record using another form with limited
capabilities. I want my managers to click a button that will reset the
password back to the default password (date of birth) for the guys record of
whom he's looking at. Here's my code:
Dim intReponse as integer
intResponse = MsgBox("Are you sure you wish to reset this FSR's password?",
vbYesNo, "Reset Password?")
If intResponse = vbYes Then
If sResetPassword(Me.Username, Me.DOB) = True Then
MsgBox "FSR's password has been reset to the default.",
vbOKOnly, "Reset Password"
Else
MsgBox "Unable to reset password. " & Err.Number & ": " &
Err.Description
End If
Else
MsgBox "Action has been canceled", vbInformation, "Cancel Changes"
Exit Sub
End If
___________________________________________________________________
Public Function sResetPassword(ByVal strUser As String, Optional varPwd As
Variant) As Integer
On Error GoTo Err_Golldarnit
Dim ws As Workspace
Set ws = DBEngine.Workspaces(0)
ws.Users.Refresh
ws.Groups("users").Users(strUser).NewPassword varPwd
sResetPassword = True
Err_Golldarnit:
MsgBox "Something went wrong" & Err.Description
Exit Sub
____________________________________________________________________
Access seems to be getting stuck on this string:
ws.Groups("users").Users(strUser).NewPassword varPwd
When I try to Compile it highlights the .NewPassword part and says, "Compile
Error. Argument not Optional"