Database Programming Techniques > Accessing Cell Data > Retrieving a bookmark relative to the current record |
To retrieve a bookmark relative to the current record, use the list's GetBookmark method, which accepts an integer offset that specifies the number of records after the current record if positive, or before the current record if negative:
Example Title |
Copy Code
|
---|---|
Dim Bmk As Variant Bmk = TDBList1.GetBookmark(0) ' Current row Bmk = TDBList1.GetBookmark(1) ' Next row Bmk = TDBList1.GetBookmark(-1) ' Previous row Bmk = TDBList1.GetBookmark(4) ' Fourth row after current row |
Note that the record referred to by the GetBookmark method need not be visible on the screen.