The Immediate window lets you write out the value of a variable in several ways. In this video, learn how to verify output using the Immediate window.
- [Teacher] So far in this course I have verified…most of my code's output using message boxes.…Message boxes are fine, but they require…that the user, probably you,…click a button to dismiss them…and continue running the program.…If you prefer to bypass message boxes…and still get feedback on your code,…you can use the immediate window.…The immediate window is a panel that appears…at the bottom of the Visual Basic Editor.…I'll demonstrate how to use the immediate window…in this movie.…I've opened the course database…and I'll create a code module.…
So to switch to the Visual Basic Editor,…I'll press Alt, F11.…From here, I can go to the insert menu…and click "module" to create a code module.…I'll start by creating a subroutine…that accepts a number as input…and then adds three to it and displays the result.…So do "Sub, Check, Error." (typing sound)…So we're checking for an error in the code.…And you'll see why that's important in a moment.…Then I will declare "LNG number" as Long,…and then a comma, and "LNG result" as Long as well.…
- 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.