MS Access 2003: Using the Immediate Window
This MSAccess tutorial explains how to use the Immediate Window in the VBA debugging environment in Access 2003 (with screenshots and step-by-step instructions).
See solution in other versions of MSAccess:
Using the Immediate Window
The Immediate window can be used to debug your program by allowing you to enter and run VBA code in the context of the suspended program.
We've found the Immediate window to be the most help when we need to find out the value of a variable, expression, or object at a certain point in the program. This can be done using the print command.
For example, if you wanted to check the current value of the combo box called cboKeyword, you could use the print command as follows:
In this example, we typed print cboKeyword And pressed ENTER. The Immediate window displayed the result in the next line. In this case, the print cboKeyword command returned monitor.
You can also type more complicated expressions in the Immediate window. (Remember to press ENTER.) For example:
The Immediate window can be used to run other kinds of VBA code, but bear in mind that the Immediate window can only be accessed when debugging so any code that you run is for debugging purposes only.
In this example, the Immediate window can be used to open a report called rptEntries.
Advertisements