ACC: "Out of Stack Memory" Error Message with SendKeys Macro
ID: Q101067
|
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.
When choosing a command button, you may receive the following error
message:
Not enough stack memory left
This error message occurs when you activate a macro from the OnPush
property in version 1.x, or the OnClick property in version 2.0, of a
command button on a form. The macro includes a SendKeys action (in which
the keystrokes sent
include the ESC key) and the Wait argument is set to Yes.
CAUSE
The Cancel property of the command button is set to Yes.
RESOLUTION
Change the Cancel property of the command button to No.
MORE INFORMATION
You receive the above error message if you choose a command button and
all the following conditions are met:
- The macro attached to the command button includes a SendKeys action.
- The command button's Cancel property is set to Yes.
- You choose the command button by pressing ESC.
If the command button activates a macro that performs a SendKeys action,
which in turn sends an ESC keystroke, the button that repeatedly activates
the macro is chosen and an endless loop results. Note that if the Wait
argument on the SendKeys action is set to No, Microsoft Access will appear
to hang.
Steps to Reproduce Behavior
- Start Microsoft Access and open the sample database NWIND.MDB.
- Create a new macro called Test Macro:
Test Macro Actions
------------------
SendKeys
Keystrokes: {esc}
Wait: Yes
- Open the Customers form in Design view.
- Add a command button to the form:
Object: Command Button
----------------------
ControlName: Test Button
Caption: Test Button
OnPush: Test Macro (version 1.x)
OnClick: Test Macro (version 2.0)
Cancel: Yes
- Switch to Form view.
- Choose the Test button. The following error message appears:
Not enough stack memory left
Keywords : kbusage McrArg
Version : 1.0 1.1 2.0
Platform : WINDOWS
Issue type : kbprb