Database Programming Techniques > Accessing and Manipulating Cell Data > Retrieving a bookmark relative to a displayed row |
To retrieve a bookmark relative to a row that is currently displayed, use the RowBookmark method, which accepts an integer offset that specifies a zero-based row number ranging from 0 to VisibleRows - 1:
Example Title |
Copy Code
|
---|---|
Dim Bmk As Variant With TDBGrid1 ' First displayed row. Bmk = .RowBookmark(0) ' Second displayed row. Bmk = .RowBookmark(1) ' Last displayed row. Bmk = .RowBookmark(.VisibleRows - 1) End With |
Note that unlike the GetBookmark method, the RowBookmark method only returns bookmarks for visible rows.