ACC2: Incorrect FindFirst Example in "Building Applications"

ID: Q121838


The information in this article applies to:


SYMPTOMS

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

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.


REFERENCES

For more information about the OpenRecordset method, search for "OpenRecordset," and then "OpenRecordset Method (Data Access)" using the Microsoft Access Help menu.

Microsoft Access "Building Applications," version 2.0, Chapter 11, "Working with Sets of Records," pages 256-257

For more information about documentation corrections, view the topic "Documentation Updates" in the Microsoft Access 2.0 ACREADME.HLP file.

Additional query words: kberrmsg


Keywords          : kbusage 
Version           : 2.0
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: April 7, 1999