?
Solved

What is this line of code doing?

Posted on 2014-12-29
3
Medium Priority
?
131 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Suggested Courses

801 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