Part II: Programming Microsoft Access
542
FIGURE 14.18
Insert a breakpoint near the location of the code you want to step through.
An alternative to setting breakpoints is to use Stop statements. The Stop statement halts execution but
is more permanent than breakpoints. A Stop statement, like any other VBA statement, persists from
session to session until explicitly removed. You can, however, surround the Stop statement with con-
ditional compilation expressions and toggle their action by changing the value assigned to a condi-
tional compilation constant. The following figure illustrates using the Stop statement.
Using Stop is a bit dangerous, however. Because Stop is an executable statement, unless it’s carefully
controlled with compiler directives, deleted, or commented out, your application will, literally, stop
executing in front of a user. You’re probably better off using regular breakpoints than Stop statements
in most situations.
Stop statements are a type of permanent breakpoint.
Using Stop statements instead of setting breakpoints