DAO Recordset Help Seems Simple

  • Thread starter Thread starter Brandon Johnson
  • Start date Start date
B

Brandon Johnson

I had it working then it decided it didnt want to work. basically its
throwing me an error down at the "if isnull(Userinfo(login_hint))..."
and the one below that in the else. It says Runtime Error '3265' Item
not found in collection. I do have login_hint in the table and like i
said i was working and i dont know what i did to make it not work all
of a sudden. If anyone can help. please. thankyou.

Dim Userinfo As DAO.Recordset
Dim Usercriteria As String
Set Userinfo = CurrentDb.OpenRecordset("tblLoginPWD",
dbOpenDynaset)

If IsNull(cboUsername) Then
MsgBox "Please make sure there is a name selected.",
vbInformation, "Information"
cboUsername.SetFocus
Exit Sub
Else
Usercriteria = "[Login_Name] = '" & cboUsername & "'"
Userinfo.FindFirst Usercriteria
If IsNull(Userinfo(login_hint)) Then
MsgBox "User: " & cboUsername & ", has not set a hint
question. Contact 7515 for password."
Exit Sub
Else
txtPassPhrase = Userinfo(login_hint)
End If
End If
Userinfo.Close
 
Assuming the name of the field you're trying to check is login_hint, you
need to refer to it as one of:

Userinfo!login_hint
Userinfo.Fields("login_hint")
Userinfo("login_hint")
 
thankyou so much. that helped. i must have changed it without thinking.
thanks again.
 
Back
Top