Sub UseBookmark()
Dim strSQL As String
Dim vntPosition As Variant
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenStatic
rst.Open "Select * from Products"
vntPosition = rst.Bookmark
Do Until rst.EOF
Debug.Print rst("ProductID")
rst.MoveNext
Loop
rst.Bookmark = vntPosition
Debug.Print rst("ProductID")
rst.Close
Set rst = Nothing
End Sub
|