AbsolutePosition

This property specifies the ordinal position of the current record of a recordset.

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 one-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 has 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.

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

AbsolutePosition supports three special values. The following table shows the values and their description.

Constant Value Description
adPosUnknown -1 The recordset is empty, the current position is unknown, or the provider does not support the AbsolutePage property.
adPosBOF -2 The current record pointer is at BOF; the BOF property is True.
adPosEOF -3 The current record pointer is at EOF; the EOF property is True.

Example

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

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