ACC97: Cannot View Class Module in a Referenced Database LibraryLast reviewed: August 29, 1997Article ID: Q160011 |
The information in this article applies to:
SYMPTOMSModerate: Requires basic macro, coding, and interoperability skills. When you open the Object Browser in Microsoft Access 97, you cannot view any of the form or report class modules in a referenced database. This article assumes that you are familiar with Visual Basic for Applications and with creating Microsoft Access applications using the programming tools provided with Microsoft Access. For more information about Visual Basic for Applications, please refer to the "Building Applications with Microsoft Access 97" manual.
CAUSEMicrosoft Access 97 corrects an anomaly with class module visibility that exists in Microsoft Access 7.0 by not allowing you to browse or view any form, report, or stand-alone class modules in a referenced database. Microsoft Access 7.0 allows you to use the Object Browser to browse forms and reports (stand-alone class modules are not supported in version 7.0), and to call their methods and properties. Microsoft Access 97 corrects this behavior by marking all form, report and stand-alone class modules as private.
RESOLUTIONTo make a class module visible in the Object Browser, declare a public variable in a standard module in the referenced database that encapsulates the class module.
MORE INFORMATIONMicrosoft Access 7.0 and 97 both support calling functions from an external database by creating a Visual Basic for Applications reference. This allows you to use the Object Browser to view functions marked as Public in a referenced database, and call the code from within the current database. The following example creates a class object in a referenced database to demonstrate how to call functions in a class module of a referenced database, and to illustrate how the reference appears in the Microsoft Access 97 Object Browser.
Create the Reference Database
Create the Front-End Database
REFERENCESFor more information about class modules, search the Help Index for "class modules," or ask the Microsoft Access 97 Office Assistant. For more information about the Object Browser, search the Help Index for "Object Browser," or ask the Microsoft Access 97 Office Assistant.
|
Additional query words: ClassMod OLE instance
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |