Finding Records

To find a record in a recordset, use the FindFirst method. This is really just a way to reposition the current record pointer (cursor) to the first record that meets some criteria you specify. The criteria is specified just like a Where clause in a SQL statement, except that you omit the word "Where." It looks like this:

rec.FindFirst "CustomerKey = " & Me!CustomerKey

After you perform a FindFirst, you can check the NoMatch property of the recordset to determine whether you successfully found at least one matching record.

Don't use the Seek method of a recordset. It doesn't offer any real advantages over the FindFirst method, and it won't work on a linked table.

0 0

Post a comment