Microsoft KB Archive/89603

= ACC: Close Action from Function Does Not Trigger OnClose Error =

Article ID: 89603

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

-



This article was previously published under Q89603



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



SYMPTOMS
If a form's OnClose property points to a nonexistent Access Basic function, no error message is generated when you exit the form with a Close action called from an Access Basic function.



RESOLUTION
Close the form with a Close action called from a macro rather than with a Close action called from a function.



STATUS
This behavior no longer occurs in Microsoft Access version 7.0.



Steps to Reproduce Behavior
  Type the following sample function CloseMein a new module and save it as Module1:

Function CloseMe DoCmd Close End Function  Create a new form and set the form's OnClose property as follows:

=Bogus Add a command button to the form and set the command button's OnClick property as follows:

=CloseMe

NOTE: In Microsoft Access version 1.x, the OnClick property is called the OnPush property. View the form in Form view. From the File menu, choose Close. Note that you do not receive an error message.</li> Open the form in Form view again. Click the command button to close the form. Note that you do not receive an error message even though the same nonexistent function is called.</li></ol>

Keywords: kbprb kbusage KB89603

-

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

© Microsoft Corporation. All rights reserved.