Recordset.MoveFirst / MoveLast / MoveNext / MovePrevious

Move to a different record within a recordset.

Syntax
      expression.MoveFirst

      expression.MoveLast

      expression.MoveNext

      expression.MovePrevious

Key
   Criteria   A String used to locate the record.
              Like the WHERE clause in an SQL statement,
              but without the word WHERE.

The Move methods move from record to record without applying a condition.

To find records that meet a specific condition — use a Find method to move from record to record. To locate a record in a table-type Recordset, use the Seek method.

If you move to another record without updating (with the Update method), your changes will be lost without warning.

When you open a Recordset, the first record is current and the BOF property is False. If the Recordset contains no records, the BOF property is True, and there is no current record.

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

If recordset refers to a table-type Recordset (Microsoft Access workspaces only), movement follows the current index. You can set the current index by using the Index property. If you don’t set the current index, the order of returned records is undefined.

You can’t use the MoveFirst, MoveLast, and MovePrevious methods on a forward–only–type Recordset object.

To move the position of the current record in a Recordset object a specific number of records forward or backward, use the Move method.

Examples

rstPatients.FindFirst "AdmissionDate > #" & Format(Me!txtAdmission, 'm-d-yy' ) & "#"

“Twenty years from now, you will be more disappointed by the things you didn’t do than by the ones you did do. So throw off the bowlines, sail away from the safe harbour. Catch the trade winds in your sails. Explore. Dream. Discover” ~ Mark Twain

Related

FindFirst/Last/Next/Previous Record
.Move - Move through a Recordset.
RecordSet.Close - Close a recordset
OpenRecordset - Create a new Recordset
Update - Save a recordset
CancelUpdate - Cancel recordset changes


 
Copyright © 1999-2024 SS64.com
Some rights reserved