ACC97: Debug Window Is Not Displayed After Using Echo Method

Last reviewed: August 29, 1997
Article ID: Q161758
The information in this article applies to:
  • Microsoft Access 97

SYMPTOMS

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

When you use the Echo method of the Application object to turn off screen repainting in your application, the Debug window is not displayed properly when you encounter an error in your code.

CAUSE

Screen repainting is turned off and the "Debug Window On Top" check box is not selected.

RESOLUTION

Make sure the "Debug Window On Top" check box is selected as the default. Or, create a macro that turns on repainting and assign the macro to a custom key command or custom menu command. You can then use the key combination or menu command to turn repainting on if it has been turned off in Visual Basic. To create a key assignment for a macro do the following:

  1. In the Database window, click the Macros tab, and then click New to open a new macro.

  2. Create the following new macro and save it as "Autokeys":

          Macro Name  Action
          ------------------
    
          ^E          Echo
    
          ^E Actions
          -------------------------------
          Echo On: Yes
          Status Bar Text: Echo turned on
    
    

  3. The new macro assignment is in effect as soon as you save the macro and will be available each time you open the database.

MORE INFORMATION

If the "Debug Window On Top" check box is not selected when you click the Modules tab under Options on the Tools menu, the Debug window will not be updated properly if you turn Echo off and your code encounters an error.

Steps to Reproduce Behavior

  1. On the Tools menu, click Options.

  2. Click the Module tab, click to clear the "Debug Window On Top" check box if it is selected, and then click OK.

  3. Create a new form not based on any table or query.

  4. Add the following code to the form's OnLoad property [Event Procedure]:

          Private Sub Form_Load()
          Dim I as Integer
    
             Application.Echo False
             I=5/0
             Application.Echo True
    
           End Sub
    
    

  5. Save the form and close it.

  6. On the Tools menu, click Startup and under Display Form, select the the form that you just created as the startup form. Click OK to close the Startup box.

  7. Close the database and reopen it. Note that as the form opens, a run-time error is displayed.

  8. In the dialog box, click Debug. You see a small shadow rectangle with no visible information and no menus appear on the menu bar.

  9. Press CTRL+G to bring up the Debug window. The Debug and Run menus appear on the menu bar to indicate the Debug window is open; however, the Debug window is not visible.

NOTE: Once you have created your Autokeys macro, you can use your key combination to bring up the Debug window instead of using step 9 above.

REFERENCES

For more information about the Echo method, search the Help Index for "Echo method," or ask the Microsoft Access 97 Office Assistant.

Keywords          : kbprg kbui PgmErr
Version           : 97
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbprb


================================================================================


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: August 29, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.