Move

This method moves the position of the current record in a recordset.

Syntax

recordset.Move NumRecords, Start

Parameters

NumRecords

Signed Long expression that specifies the number of records that the current record position moves.

Start

Optional. String or Variant that is a bookmark. It is one of the values described in the following table.

Constant Value Description
adBookmarkCurrent 0 Default—start at the current record. Logically equivalent to passing no value for Start.
adBookmarkFirst 1 Start at the first record.
adBookmarkLast 2 Start at the last record.

Remarks

If the NumRecords parameter is greater than zero, the current record position moves forward, toward the end of the recordset. If NumRecords is less than zero, the current record position moves backward, toward the beginning of the recordset.

If the Move call would move the current record position to a point before the first record, ADOCE sets the current record to the position before the first record in the recordset—BOF is True. An attempt to move backward when the BOF property is already True generates an error.

If the Move call would move the current record position to a point after the last record, ADOCE sets the current record to the position after the last record in the recordset—EOF is True. An attempt to move forward when the EOF property is already True generates an error.

Calling the Move method from an empty Recordset object generates an error.

If you pass the Start parameter, the move is relative to the record with this bookmark, assuming the Recordset object supports bookmarks. If not specified, the move is relative to the current record.

Example

The following code example sets the constants for the Move method.

Const adBookmarkCurrent = 0
Const adBookmarkFirst = 1
Const adBookmarkLast = 2