Although the Filter property can be used to return a group of specific records from a recordset, you can also search for a specific record. Use the Find method to search on a record that matches your criteria.
The following example code moves the recordset pointer to the first record that has "Gray" as a last name:
rsStudents.Find "Last_Name = 'Gray'"
Parameter | Description |
---|---|
Criteria | Expression stating the field to search and the value to find. |
SkipRows | Number indicating how many rows to skip when starting the search. Set this value to zero (default) to include the current row in the search. Set it to 1 to skip the current row. |
Direction | Specifies which direction from the current record the search should progress (adSearchForward or adSearchBackward). The default is adSearchForward. |
Start | Bookmark to use as the starting position. |
The following table describes the search clauses to use when specifying criteria.
Clause | Description |
---|---|
FieldName | Name of the field being searched |
Operator | =, <, >, "like" |
Value | Date, String, Number |