Microsoft KB Archive/161758

= ACC97: Debug Window Is Not Displayed After Using Echo Method =

Article ID: 161758

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q161758



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



SYMPTOMS
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:  In the Database window, click the Macros tab, and then click New to open a new macro. 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
 On the Tools menu, click Options. Click the Module tab, click to clear the "Debug Window On Top" check box if it is selected, and then click OK.</li> Create a new form not based on any table or query.</li>  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 </li> Save the form and close it.</li> 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.</li> Close the database and reopen it. Note that as the form opens, you receive a run-time error.</li> In the dialog box, click Debug. You see a small shadow rectangle with no visible information and no menus appear on the menu bar.</li> 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.</li></ol>

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.

<div class="references_section">