ACC97: Debug Window Is Not Displayed After You Use Echo Method

ID: Q161758

The information in this article applies to:

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, follow these steps:

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

The new macro assignment is in effect as soon as you save the macro and will be available each time that 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. Set the form's OnLoad property to the following 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, you
   receive a run-time error.

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 that the Debug window is open;
   however, the Debug window is not visible.

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

REFERENCES

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

Additional wuery words:

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

Last Reviewed: November 21, 1998