AbsolutePosition

This property specifies the ordinal position of the current record of a Recordset object.

Syntax

var = recordset.AbsolutePosition

Return Values

Returns a Long value from 1 to the number of records in the Recordset object (RecordCount).

Remarks

Use the AbsolutePosition property to move to a record based on its ordinal position in the Recordset object.

Like the AbsolutePage property, AbsolutePosition is 1-based and equals 1 when the current record is the first record in the Recordset. You can obtain the total number of records in the Recordset object from the RecordCount property.

Do not use the AbsolutePosition property as a surrogate record number. The position of a specified record changes when you delete a preceding record. There is also no assurance that a specified record will have the same AbsolutePosition if you reopen the Recordset object. Bookmarks are the recommended way of retaining and returning to a specified position and are the only way of positioning across all types of Recordset objects.

AbsolutePosition supports three special values: -1 (adPosUnknown), -2 (adPosBOF), and -3 (adPosEOF).

Attempting to set AbsolutePosition to any zero or negative value results in an error.

The following code example sets the constants for the AbsolutePosition property.

Const adPosUnknown = -1
Const adPosBOF = -2
Const adPosEOF = -3