Microsoft KB Archive/94926

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

Article ID: 94926

Article Last Modified on 5/9/2003

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition
 * Microsoft Access 95 Standard Edition

-



This article was previously published under Q94926



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



SYMPTOMS
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.



Steps to Reproduce Behavior
  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)   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)  Create a new form. Assign the CloseForm macro to the form's OnOpen property. Save the form as Form1. View the form in Form view.</li> Create a new report. Assign the CloseReport macro to the report's OnOpen property. Save the report as Report1.</li> Preview the report. Note that the computer beeps and you receive one of the error messages mentioned in the &quot;Symptoms&quot; section. Note that you did not receive an error message in step 4 when you opened the form.</li></ol>

Keywords: kbprb kbusage KB94926

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.