Access VBA Macro Programming

(Joao Candeias) #1

You can set the Debug window, as shown in Figure 7-3, by using Debug | Add Watch from
the menu.
Enter the variable or expression you wish to monitor in the Expression box. For example,
if you have a variablexand wish to keep track of its value, enterxin the box. The context
details are entered automatically but can be amended. You can also specify whether you want
the code to break when the value of the variable is True (nonzero) or when the value changes.
Click OK and the Debug window will appear with details of your variable in it, as shown
in Figure 7-4.
When the program reaches a breakpoint, the value in the Debug window is updated. As
you step through, it will also be updated. You can delete a watch expression by highlighting
the expression in the watch window, clicking it, and then pressing theDELETEkey.
To edit the watch expression, right-click the selected expression and select Edit Watch.


Chapter 7: Debugging 87


Figure 7-3 Adding a watch on a variable

Free download pdf