AbsolutePosition Property Example (MDB)

The following example finds a particular record in a dynaset-type Recordset object and determines the ordinal position of that record:

Sub RecordOrdinalPosition()
    Dim dbs As Database, rst As Recordset

    ' Return reference to current database.
    Set dbs = CurrentDb
    ' Return reference to dynaset-type Recordset object object.
    Set rst = dbs.OpenRecordset("SELECT * FROM Orders WHERE " _
        & "ShippedDate >= #1-1-96#;")
    ' Find first order shipped to London.
    rst.FindFirst "ShipCity = 'London'"
    ' Return ordinal position of that record.
    Debug.Print rst.AbsolutePosition
    rst.Close
    Set dbs = Nothing
End Sub