The following example creates a Recordset object by using an SQL statement on an Employees table and then uses the Clone method to create a clone of the Recordset object so that bookmarks can be shared between the two objects. This technique is especially useful when you have to compare the results of a query from more than one point at the same time.
The function reads and stores in a string variable the value of the Bookmark property for the current record, in this case the second record in the original Recordset object. The Bookmark property of the duplicate Recordset object is set to this string, making the second record the current record in this Recordset object as well. The current values of the LastName field for both recordsets are identical, as you can see once they are printed in the Debug window.
Sub CreateClone()
Dim dbs As Database
Dim rstEmployees As Recordset, rstDuplicate As Recordset
Dim fldName As Field, varBook As Variant
' Return reference to current database.
Set dbs = CurrentDb
' Open dynaset-type Recordset object.
Set rstEmployees = dbs.OpenRecordset("SELECT * " _
& "FROM Employees ORDER BY LastName")
' Clone Recordset object.
Set rstDuplicate = rstEmployees.Clone
Set fldName = rstEmployees.Fields!LastName
' Set current record.
rstEmployees.MoveFirst
' Move to second record.
rstEmployees.MoveNext
' Get Bookmark property value and print current field value.
If rstEmployees.Bookmarkable Then
varBook = rstEmployees.Bookmark
Debug.Print fldName.value
Else
' If Recordset object doesn't support bookmarks,
' exit procedure.
ExitCreateClone
End If
' Set Bookmark property of clone to obtained value.
rstDuplicate.Bookmark = varBook
Debug.Print fldName.value
ExitCreateClone:
rstEmployees.Close
rstDuplicate.Close
Set dbs = Nothing
End Sub