MoveFirst, MoveLast, MoveNext, MovePrevious Methods

See AlsolanMoveMethodsSee

Description

Move to the first, last, next, or previous record in a specified recordset22S7WAF and makes that record the current record1BNJB8X.

Syntax

recordset.MoveFirst

recordset.MoveLast

recordset.MoveNext

recordset.MovePrevious

Remarks

Each Move method uses these parts:

Part                 Description

 

recordset          The Recordset property of a data control.  in the Professional Edition, can also be an object variableZ3R9Q5 identifying a Table, Dynaset, or Snapshot.  If recordset does not exist or is an unopened Table, an error occurs.

 

The buttons on a data control correspond to the MoveFirst, MovePrevious, MoveNext, and MoveLast methods, respectively.  The BOF and EOF properties never become True when using the data control buttons.

If you use MoveFirst or MoveLast when the first or last record is already current, the current record doesn't change.

If you use MoveLast on a Dynaset which is the result of a query, you force the query to completion.

If you use MovePrevious when the first record is current, the BOF property will be True and there will be no current record. If you use MovePrevious again, an error occurs and BOF remains True.

If you use MoveNext when the last record is current, the EOF property will be True and there will be no current record. If you use MoveNext again, an error occurs and EOF remains True.

When you open recordset, the first record is current and the BOF property is False.  If recordset contains no records, both BOF and EOF properties are True, and there is no current record.

With a data control, if an Edit or AddNew operation is pending when you use one of the Find or Move methods, Update is automatically invoked if not stopped during the Validate event.

 

Caution   In the Professional Edition, if you are not using a data control and use one of the Find or Move methods while an Edit or AddNew operation is pending, any existing changes will be lost and no error will occur.

 

In the Professional Edition, if recordset refers to a Table, movement follows the Table's current index1UO70XX.  If there is no current index, movement between records follows the order in which records were added.