SETTING BREAKPOINTS WITH THE TOGGLE BREAKPOINT COMMAND


A breakpoint is an instruction that causes the compiler to halt execution and enter break mode.

The simplest way to set a breakpoint is to put your cursor where you want the breakpoint and choose Debug, Toggle Breakpoint (or press F9). Choose this command a second time to clear a breakpoint.

You can set as many breakpoints in a procedure as you like using this method. The Toggle Breakpoint command sets an unconditional breakpoint—one that will always occur when execution arrives at the breakpoint. To set a conditional breakpoint— one that takes effect under a specified condition only—see the next section.

The VBE highlights a line where you’ve set a breakpoint in a contrasting color and displays a large bullet in the left margin of the Code window. To customize the highlighting color, choose Tools, Options, click the Editor Format tab, and select Breakpoint Text.