J
James
I'm trying to run this code to display the user's password (in an admin
console) but i can't remember how to clear the currentdb (if that's
what i need to do) Whatever user i retrieve their password first, that
password shows up for every person i try to retrieve thereafter. Here's
my code. Thanks!
Private Sub cmdFindPassword_Click()
Dim strSQL As String
Dim db As Dao.Database
Dim qd As Dao.QueryDef
Dim msgBoxText As String
Dim display As Integer
Dim test As Variant
On Error GoTo Error_Handler
'msgBoxText = "Are you sure you want to delete user: '" & Me!cboUserID
& "'"
'If MsgBox(msgBoxText, vbYesNo + vbQuestion, "Delete Warning") = vbYes
Then
Set db = CurrentDb
'define the SQL of the query to delete the record
strSQL = "SELECT passwd FROM UserIDandPassword WHERE [USERID] =
'" & Me!cboUserID & "'"
'create an unnamed new query definition (the "" is the name)
Set qd = db.CreateQueryDef("", strSQL)
msgBoxText = "The password for " & Me!cboUserID & " is: " &
passwd
display = MsgBox(msgBoxText, vbInformation + vbOKOnly)
cboUserID = ""
Me.Refresh
Exit_Method:
Exit Sub
Error_Handler:
MsgBox Err.Description
Resume Exit_Method
End Sub
console) but i can't remember how to clear the currentdb (if that's
what i need to do) Whatever user i retrieve their password first, that
password shows up for every person i try to retrieve thereafter. Here's
my code. Thanks!
Private Sub cmdFindPassword_Click()
Dim strSQL As String
Dim db As Dao.Database
Dim qd As Dao.QueryDef
Dim msgBoxText As String
Dim display As Integer
Dim test As Variant
On Error GoTo Error_Handler
'msgBoxText = "Are you sure you want to delete user: '" & Me!cboUserID
& "'"
'If MsgBox(msgBoxText, vbYesNo + vbQuestion, "Delete Warning") = vbYes
Then
Set db = CurrentDb
'define the SQL of the query to delete the record
strSQL = "SELECT passwd FROM UserIDandPassword WHERE [USERID] =
'" & Me!cboUserID & "'"
'create an unnamed new query definition (the "" is the name)
Set qd = db.CreateQueryDef("", strSQL)
msgBoxText = "The password for " & Me!cboUserID & " is: " &
passwd
display = MsgBox(msgBoxText, vbInformation + vbOKOnly)
cboUserID = ""
Me.Refresh
Exit_Method:
Exit Sub
Error_Handler:
MsgBox Err.Description
Resume Exit_Method
End Sub