Solved

What is this line of code doing?

Posted on 2014-12-29
3
111 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
  • 2
3 Comments
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 250 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 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 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 57
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now