ACC: "Out of Stack Memory" Error Message with SendKeys Macro

Last reviewed: May 28, 1997
Article 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

  1. Start Microsoft Access and open the sample database NWIND.MDB.

  2. Create a new macro called Test Macro:

          Test Macro Actions
          ------------------
          SendKeys
    
             Keystrokes: {esc}
             Wait: Yes
    
    

  3. Open the Customers form in Design view.

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

  5. Switch to Form view.

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