Step through Visual Basic code
Stepping through your Visual Basic code can help you identify where an error is occurring. You can see whether each line of code produces the results you expect.
- Suspend execution of the code.
How?
Microsoft Access displays the line of code where execution is suspended.
- Do one of the following:
- To step through each line of code and into the code in a procedure called by another procedure, click Step Into on the Debug toolbar.
- To step through each line of code but run as a unit any procedure that is called, click Step Over on the Debug toolbar.
- To run the code that precedes the current line of code, and then break so you can step through each line of code, click Run To Cursor on the Debug menu.
- To run the rest of the current procedure, and then return to the next line of code in the preceding procedure in the call tree, click Step Out on the toolbar.
Note You can use Step Into without suspending code execution. In the Visual Basic Editor Code window, place your cursor in the procedure you want to step through, and click Step Into on the toolbar.
You can alternate between these types of stepping. The type of stepping you do depends on which portions of code you want to analyze.