Returns a CompareEnum value that compares the relative rowposition of two bookmarks in the same Recordset object.
The CompareBookmarks method returns one of the CompareEnum constants that allows you
to compare the relative row positions of two records based upon the values of their bookmarks.
Note that you are comparing bookmarks, not the values contained in the fields of the records.
CompareEnum Constants
Constant | Value | Description |
---|---|---|
adCompareEqual | 1 | Bookmarks are equal |
adCompareGreaterThan | 2 | First bookmark is after second bookmark |
adCompareLessThan | 0 | First bookmark is before second bookmark |
adCompareNotComparable | 4 | Bookmarks cannot be compared |
adCompareNotEqual | 3 | Bookmarks are not equal or in order |
If objRecordset.CompareBookmarks(Bookmark1, Bookmark2) = adCompareEqual Then
MsgBox "Bookmarks Are Equal", vbOK
Else
MsgBox "Bookmarks Are Not Equal", vbOK
End If