ACC95: Opening Multiple Instances of Report Binds Data Too SoonLast reviewed: August 28, 1997Article ID: Q154573 |
The information in this article applies to:
SYMPTOMSAdvanced: Requires expert coding, interoperability, and multiuser skills. The order of report event procedures change when you open an "instance" of a report. When opening an "instance" of a report, the OnOpen event of the report occurs after the report has already bound to the data or recordset for the report. Typically, the OnOpen event for reports occurs before the report has bound to the data or record source, allowing the option of changing the RecordSource property for the report from this event.
STATUSMicrosoft has confirmed this to be a problem in Microsoft Access 7.0. This problem no longer occurs in Microsoft Access 97.
MORE INFORMATIONWhen a report is opened from the Database window, the OnOpen event changes the record source to another table . When an additional report instance is called from a function, like the one below, an error occurs:
Run-time error '2191' You can't set the RecordSource property after printing has started. Solution Try setting this property from the OnOpen event.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 for Windows 95" manual.
Steps to Reproduce Problem
REFERENCESFor more information about creating multiple instances of an object, search on "What's new," using the Microsoft Access 7.0 Answer Wizard. Click the topic "What's new for Developers: Overview," click "Programming with Forms and Reports," and then view "Creating an Instance of a Form." Keywords : kbprg PgmHowTo PgmObj Version : 7.0 Platform : WINDOWS Hardware : x86 Issue type : kbbug Solution Type : kbfix |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |