Breakpoints let you halt your VBA code execution so you can examine its variables and outputs. In this video, learn how to set breakpoints in your code.
- [Instructor] When you test your VBA code,…you will often want to stop your procedure partway through…so that you can verify everything is working correctly…up to that point.…You can cause your code to stop intentionally…by setting a breakpoint.…I'll demonstrate how to do that in this movie.…I have opened the course database file…and I'll press Alt F11 to move to the Visual Basic Editor.…I want a code module to work with…so I will go to the insert menu, click module,…and there we go.…
The first thing I'll do is create two subroutines.…I'll type Sub DbaseName.…And I won't pass any arguments to it,…so I'll leave the parentheses blank…and I'll have Dim sName as string.…Then sName equals order tracking.…Then I will call the subroutine that I'm about to write…so that'll be ShowDbaseName and I will pass it, sName,…the variable we just assigned order tracking to.…
And then message box…with the prompt end of the subroutine.…So I've got parentheses, and then the string,…end of the subroutine, within double quotes.…And I already have my end sub line.…
- Working with macros
- Running a VBA procedure
- Debugging VBA code
- Defining variables, constants, and calculations
- Displaying a calculated result in a message box
- Repeating tasks with loops
- Manipulating database objects
- Adding, editing, and deleting records
- Looking up values in a table
- Automating processes with macros
Skill Level Advanced
What you should know1m 38s
1. Introduction to Visual Basic for Applications
2. Define Variables, Constants, and Calculations
3. Add Logic to Your VBA Code
4. Debug Your VBA Code
5. Manipulate Database Objects Using DoCmd
6. Read and Manipulate Table Data
7. Manipulate a Database Using the Application Object
8. Control Forms and Reports Using the Me Object
9. Automate Processes Using Macros
Next steps1m 7s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.