Solved

Recordset bookmarks

Posted on 2013-10-30
4
311 Views
Last Modified: 2013-11-01
This code doesn't seem change the bookmark value.  I can't tell why not.
    Dim State_rst As DAO.Recordset
    Dim lngCountOfSourceItems As Long
    Dim lngOriginatingRecord As Long           ' will be a recordset bookmark
    Dim i As Integer ' my record counter index

    Set State_rst = CurrentDb.OpenRecordset("tblStates", dbOpenDynaset)
    State_rst.MoveLast           'Makes sure count below is correct
    Let lngCountOfSourceItems = State_rst.RecordCount
    State_rst.MoveFirst          ' Make sure to start at beginning
    For i = 1 To lngCountOfSourceItems
        Let lngOriginatingRecord = State_rst.Bookmark 
        << do something >>
    State_rst.MoveNext
    Next

Open in new window

0
Comment
Question by:DrftrBob
[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
  • 3
4 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 39612867
Dim lngOriginatingRecord As Variant' will be a recordset bookmark

Change

Let lngCountOfSourceItems = State_rst.RecordCount

To

lngCountOfSourceItems = State_rst.RecordCount

You don't need or want Let.

m
0
 

Author Comment

by:DrftrBob
ID: 39612893
If I may ask a silly question, what type of data is a bookmark?  If silly, I can accept that.  I suppose debug.print won't display the data properly.  My watched variable seems to be an array now.  Dang - it's late.
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 39612907
"what type of data is a bookmark"
Variant (binary string)
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 500 total points
ID: 39612910
"Bookmark: A property of a Recordset object or a form that contains a binary string identifying the current record.) that uniquely identifies the current record (current record: The record in a recordset that you can modify or retrieve data from. There is only one current record in a recordset, but a recordset may have no current record, for example, after a record has been deleted from a dynaset-type recordset.) in a Recordset object.
"
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

688 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