Quick Find: Search for:
Free Resources
from FMS
 

Demos

Email Newsletter

Technical Papers

Tips and Techniques

Links

Book Recommendations

View all FMS products for Microsoft AccessMicrosoft Access Resource Center

 

 

"Thank you! Thank you!
I just finished reading this
document, which was part of a link in the recent Buzz newsletter. I have printed it for others to read, especially those skeptical on the powers of Access and its capabilities.
" 
- Darren D.
 
  

 

Debugging Tips for VBA, Access and Visual Basic Developers

Provided by: Luke Chung, President of FMS, Inc.

Access, VBA, and Visual Basic developers are blessed by a powerful code debugging environment. Learning its features will help you code better and faster, and simplify applications testing and maintenance.

In addition to being able to change your code (within reason) while in the debugger, you have the immediate window, locals window, watch window, call stack and other resources under the View menu to help you debug and understand what your code is doing. Make sure you learn what these windows can do for you.

As you examine your code line-by-line, here are some keystrokes every VB/VBA developer should use within the IDE:

Keystroke Description - Shift-F2 Put the cursor on the variable, procedure, or property in question and press [Shift-F2] to see where it’s defined. You’ll jump directly to it. You can do this as often as you like to understand how your code works.

Ctrl-Shift-F2

Go back to where you came when you pressed [Shift F2]

F9

Set (or reset) a breakpoint to stop the program when it gets to this line

F5

Run the current procedure (if it doesn’t require parameters)

F8

Run the current line

Shift-F8

Step over the line by running the procedure on the current line without going into it and stepping through each line

Ctrl-Shift-F8

Run through the rest of the current procedure (useful if you no longer need to examine the procedure)

Ctrl-F9

Set the next statement (jump over existing code)

For more tips on debugging, read Luke Chung’s technical paper on Access VBA/VB Debugging Tips and Techniques.

Return to the tips page.

Questions  l   Web questions: Webmaster   l   Copyright © 2008 FMS, Inc.

Celebrating 21 Years of Software Excellence