declares a Variant variable named myBookmark and then assigns to it a bookmark representing the current record in an ADO recordset: : Recordset Bookmark « Access « VBA / Excel / Access / Word






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

1.Marking Records with a Bookmark
2.Does it support bookmark
3.Save Bookmark to an array
4.Using Bookmarks to Filter Records