Solved

Recordset bookmarks

Posted on 2013-10-30
4
306 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

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.
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
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…

738 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