Learn Access 2003 VBA with The Smart Method
82
www.LearnAccessVBA.com
Lesson 4-6: Use the locals
window to view and change
variable contents
If you thought that the immediate window was amazing you’ll find the
locals window even more so.
This window allows you to see the values of all currently available
variables (variables that are currently available are said to be in scope.
We’ll be learning more about scope in a later lesson).
1
Set a break point in your code on the Beep command in the
ThankYouMessage sub routine.
2
Click the command button on your frmTest form to begin
code execution.
The code editor window opens with code execution halted at the
Beep command.
3
Click the Locals Window button
on the debug toolbar.
The contents of the variable strMessage is displayed within the
locals window.
4
Click on the Value “Thank you for pressing me", change the
text to “Unbelievable!!" and press the <Enter> key.
Session4b