ACC: Close Action from Function Does Not Trigger OnClose Error
ID: Q89603
|
The information in this article applies to:
-
Microsoft Access versions 1.0, 1.1, 2.0
SYMPTOMS
Moderate: Requires basic macro, coding, and interoperability skills.
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.
MORE INFORMATION
Steps to Reproduce Behavior
- Type the following sample function CloseMe()in 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.
- 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.
Keywords : kbusage FmsEvnt
Version : 1.0 1.1 2.0
Platform : WINDOWS
Issue type : kbprb