[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

What is this line of code doing?

Posted on 2014-12-29
3
Medium Priority
?
135 Views
Last Modified: 2014-12-29
I'm working with an old Access 2003 database and on a particular form there is a combobox.  In the afterupdate event of the combobox is this line of code:

If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Can someone tell me what it does?

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 1000 total points
ID: 40521825
A bookmark is a pointer or tag for a given record within a recordset.  It's used to jump back to a specific point in a recordset.

Further on in the code, you'll find a place where it's being used to move back to a record.

Jim.
0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1000 total points
ID: 40521837
Also, it's checking for the recordset's EndOfFile (EOF) before doing that. In English:

If the recordset is not at the end of the file, then move form's bookmark to the recordset's bookmark.
0
 
LVL 58
ID: 40521949
One important point on bookmarks; the values don't survive a requery or anything that causes the recordset to be re-created (a close and open).

They are only valid for the current recordset.  Once you close it or requery it, any saved bookmark values are invalid.

 So it's not something you can save forever.  It's sole purpose is to be able to move back to a given record quickly in a recordset that your currently using.  In using it, you don't need to save a key for the record, then do a find.  That is however what your forced to do if you can't use a bookmark (say because you are doing a requery).

Jim.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question