Using the Debug Window
To execute code in the Debug window while in break mode
1. Type a line of code in the Debug window.
2. Press Enter to execute the statement.
Use the Debug window to:
Test problematic or newly written code.
Query or change the value of a variable while running an application. While execution is halted, assign the variable a new value as you would in code.
Query or change a property value while running an application.
Simulate a run-time error . To see which error-message dialog box is associated with a given error code, type:
Call procedures as you would in code.
View debugging output while the program is running.
Note Debug window statements are executed in a contextthat is, as if they are entered in a specific form or module. This context appears in the title bar of the Debug window.
If you need help on syntax for functions, statements, properties, events, or methods while working in the Debug window, select the keyword or the property, event, or method name, and press F1.
While in the Debug window, you can do most of the things you do in the Code window If you want to save such code, copy or cut it and then paste it into the Code window., but statements in the Debug window are not saved with the project.
Chapter 9, "Debugging"