Move (ADO)

Moves the position of the current record in a Recordset object.

Syntax

recordset.Move NumRecords, Start

The Move method syntax has these parts.

Part Description
NumRecords A signed Long expression specifying the number of records the current record position moves.
Start Optional. A String or Variant that evaluates to a bookmark.

Remarks

If the NumRecords argument 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, ADO 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, ADO 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 argument, 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.

Start can be one of the three special bookmarks defined by the ADO BookmarkEnum, namely:

Constant Value Description
adBookmarkCurrent 0 Current record (logically equivalent to passing no value for Start)
adBookmarkFirst 1 The first record in the recordset
adBookmarkLast 2 The last record in the recordset