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

  • 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")
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?

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

with rs
    .FindFirst "[commentid] = 6241"
     if  not .nomatch then
          Me.Bookmark = .Bookmark
         msgbox "Record not found!"
     end if
end with
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!

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