totn Access 2003 VBA Debugging

MS Access 2003: Set breakpoint in VBA

This MSAccess tutorial explains how to set a breakpoint in the VBA debugging environment in Access 2003 (with screenshots and step-by-step instructions).

What is a Breakpoint?

A breakpoint is a selected line of code that once reached, your program will momentarily become suspended. Once suspended, you are able to use VBA's debugging environment to view the status of your program, step through each successive line of code, continue execution of the code, or halt execution of the code.

You can create as many breakpoints in your code as you want. Breakpoints are particularly useful when you want to suspend your program where you suspect a problem/bug exists.

Setting a Breakpoint

Next, let's look at how to set a breakpoint.

First, you need to access the VBA environment. The quickest way to do this is by pressing Alt+F11 while your Access database file is open.

To set a breakpoint, find the line of code where you'd like to suspend your program. Left-click in the grey bar to the left of the code. A red dot should appear and the line of code should be highlighted in red.

Microsoft Access

In this example, we've created a breakpoint at the following line of code:

If IsNull(cboKeyword) = True Then