FindFirst, FindLast, FindNext, FindPrevious Methods

See AlsolanFindMethodsSee                 Example 1lanFindMethodsX1>Low              Example 2 (Professional Edition Only)lanFindMethodsX2>Low

Description

Locate the first, last, next, or previous record that satisfies the specified criteria and make that record the current record1BNJB8X.

Syntax

recordset.FindFirst criteria

recordset.FindLast criteria

recordset.FindNext criteria

recordset.FindPrevious criteria

Remarks

Each Find 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 Dynaset, or Snapshot.

criteria              String expression1330R89 (the WHERE clause in an SQL string29F05E5 without the word "WHERE") specifying the records you want.

 

If recordset contains more than one record that matches criteria, FindFirst locates the first occurrence, FindNext locates the next occurrence, and so on.  You can follow a Find operation with a Move operation, such as MoveNext, which moves to the next record regardless of whether it matches any criteria.

If no matching records are found, the NoMatch property is True and the current record remains the same as before the Find method was used.

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.