Sub TestBookmark()
Dim rst As ADODB.Recordset
Dim varMyBkmrk As Variant
Set rst = New ADODB.Recordset
rst.Open "Employees", CurrentProject.Connection, adOpenKeyset
If Not rst.Supports(adBookmark) Then
MsgBox "This recordset does not support bookmarks!"
Exit Sub
End If
varMyBkmrk = rst.Bookmark
Debug.Print rst.Fields(1).Value
rst.AbsolutePosition = 7
Debug.Print rst.Fields(1).Value
rst.Bookmark = varMyBkmrk
Debug.Print rst.Fields(1).Value
rst.Close
Set rst = Nothing
End Sub
|