Learn Access 2003 VBA with The Smart Method
76
www.LearnAccessVBA.com
Lesson 4-3: Understand step
over and step out
1
Begin in exactly the same way as the previous lesson by
setting a breakpoint at the line
Call ThankYouMessage
.
2
Return to the form and Click the cmdPressMe command
button.
You are transferred to the code editor with code execution halted
at the breakpoint.
3
Click the Step Over button
on the debug toolbar.
An audible Beep is heard as the code in ThankYouMessage
executes and the Message Box is immediately displayed.
This happened because the code in the ThankYouMessage sub will
execute as normal and will not be stepped through as we
requested that VBA stepped over the subroutine.
Click the OK button and execution halts at End Sub in the
cmdPressMe_Click event handler.
This is very useful when you want to examine the way code is
executed in a single sub but have no interest in the code within any
other subs that it may call.
4
Click the Step Over button
(or Step Into button
) on
the Debug Toolbar.
Session4a