Microsoft KB Archive/121838

= ACC2: Incorrect FindFirst Example in "Building Applications" =

Article ID: 121838

Article Last Modified on 7/5/2002

-

APPLIES TO


 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q121838



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
Page 256 of the Microsoft Access version 2.0 "Building Applications" manual contains an example of using the FindFirst and FindNext methods to locate all records satisfying a particular criterion. However, if you re-create and run this example, you will receive the following error message:

Invalid Operation.



CAUSE
This error occurs because the example contains an error. The example uses the OpenRecordset method to open the Employees table as a table-type Recordset object, but the FindFirst method is not available with table-type Recordset objects.



RESOLUTION
Change the line in the example that reads

  Set MySet=MyDB.OpenRecordset("Employees")

to the following line:

  Set MySet=MyDB.OpenRecordset("Employees",DB_OPEN_DYNASET)



STATUS
This behavior no longer occurs in Microsoft Access version 7.0.

