ACC: Cannot Process Close Action in Report's OnOpen Property

Last reviewed: May 28, 1997
Article ID: Q94926
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1, 2.0, 7.0

SYMPTOMS

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

When you attempt to process a Close action in a macro that is assigned to a report's OnOpen property, you may receive the following error message.

   In Microsoft Access for Windows 95 version 7.0:

      A macro specified as the OnOpen, OnClose, OnFormat, OnRetreat,
      OnPage, or OnPrint property setting contains an invalid action for
      the property.

   In Microsoft Access version 2.0:

      Can't run this action while processing a form or report event

   In Microsoft Access version 1.1:

      Can't run this action while processing a report event

   In Microsoft Access version 1.0:

      This action can't be run while processing a form or report event.

RESOLUTION

Do not use a Close action in a macro that is assigned to a report's OnOpen property.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create the following new macro called CloseForm:

          Macro Name   Action
          -------------------
          CloseForm    Beep
                       Close
    
          CloseForm Actions
          ---------------------
          Close
             Object Type: Form
             Object Name: Form1
             Save:        No     (In Microsoft Access 7.0 only)
    
    

  2. Create the following new macro called CloseReport:

          Macro Name    Action
          --------------------
          CloseReport   Beep
                        Close
    
          CloseReport Actions
          -----------------------
          Close
             Object Type: Report
             Object Name: Report1
             Save:        No     (In Microsoft Access 7.0 only)
    
    

  3. Create a new form. Assign the CloseForm macro to the form's OnOpen property. Save the form as Form1.

  4. View the form in Form view.

  5. Create a new report. Assign the CloseReport macro to the report's OnOpen property. Save the report as Report1.

  6. Preview the report. Note that the computer beeps and you receive one of the error messages mentioned in the "Symptoms" section. Note that you did not receive an error message in step 4 when you opened the form.


Keywords : kbusage RptProp
Version : 1.0 1.1 2.0 7.0
Platform : WINDOWS
Hardware : X86
Issue type : kbprb
Resolution Type : Info_Provided


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: May 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.