From the course: Access: VBA

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Step through a subroutine or function

Step through a subroutine or function

From the course: Access: VBA

Start my 1-month free trial

Step through a subroutine or function

- [Instructor] Running a VBA procedure shows you the codes end result but it doesn't show you how the code arrived at that result. If you want to dig into a section of code to find out how it works or to identify the cause of an error, you can move through the code step by step. I'll demonstrate how to do that in this movie. I have opened the course database and I'll press ALT + F11 to move to the Visual Basic editor. From here I want to insert a code module. So I'll go to the insert menu and click module and there we go. I'll create two different subroutines one which calls the other so that we can do various forms of stepping through. The first routine will be Sub DbaseName. You'll see why it's called that in a second. I will leave the parentheses open with nothing between them because we're not sending any variables into the subroutine but we will to the other. I'll define a string Dim sName As String. We'll assign a value sName = then in double quotes Order Tracking plus double…

Contents