declares a Variant variable named myBookmark and then assigns to it a bookmark representing the current record in an ADO recordset:
Sub main()
Dim myDatabase As dao.Database
Set myDatabase = OpenDatabase(CurrentProject.Path & "\mydb.mdb")
Dim myRecordset As dao.Recordset
Set myRecordset = myDatabase.OpenRecordset(Name:="SELECT * FROM Customers WHERE Country='Germany'", Type:=dbOpenDynaset)
Dim myBookmark As Variant
myBookmark = myRecordset.Bookmark
End Sub
Related examples in the same category