Databases Reference
In-Depth Information
Figure 8-4. The events for a Workbook object
8.4 The Immediate Window
The Immediate window (see Figure 8-1) has two main functions. First, we can send
output to this window using the command Debug.Print . For instance, the code shown in
Figure 8-5 produces the result shown in the Immediate window (there were four records
in the recordset when I executed this code). (We will see how to execute the code in a
procedure shortly.) This provides a nice way to experiment with different code snippets.
The other main function of the Immediate window is to execute commands. We can enter
a line of code directly in the Immediate window. Hitting the Enter key at the end of the
line asks Access to execute that line of code. Note that this only works for single physical
lines of code, but you can place more than one logical line of code on the same physical
line by separating the logical lines with colons, as in:
For i = 1 To 10: Debug.Print i: Next i
Figure 8-5. The Immediate window
 
Search WWH ::




Custom Search