[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 724
  • Last Modified:

access recordset.findfirst does not work

Hi! I have some VBA that's supposed to find and navigate to a certain record, but it isn't.

Here's the code:
Set rs = Me.RecordsetClone
rs.FindFirst ("commentid = 6241")
Forms!catwebwork2f.CatWebWork2CommentsSummaryF.Form.CommentID)
Me.Bookmark = rs.Bookmark

Open in new window


But the form stays on the record it's on.

In the immediate window, if I ask ?me.commentid I get  2387, but if I ask ?rs.commentid I get an error: Method or Data Member not Found.

Any ideas?

Thanks!
0
etech0
Asked:
etech0
1 Solution
 
fhlio_adminCommented:
What's the chance of attaching a scrubbed (clean of personal information) database?
0
 
Rey Obrero (Capricorn1)Commented:
Set rs = Me.RecordsetClone

with rs
    .FindFirst "[commentid] = 6241"
     if  not .nomatch then
     
          Me.Bookmark = .Bookmark
         else
         msgbox "Record not found!"
     end if
end with
0
 
etech0Author Commented:
@capricorn1: Okay, that's the problem - it's not finding it. I don't know why it wasn't finding it - I replaced the code to get the commentID with a valid CommentID, so it should have worked. I back the actual code, and it works now. Thanks!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now