Code modules hold the VBA scripts you write. In this video, learn how to create, export, and delete code modules.
- [Instructor] When you are ready to write VBA code,…that can be used anywhere in your database,…not just attached to a particular form or other object.…You can create a code module.…I'll demonstrate how to do that in this movie.…And I have opened the course database…and moved to the Visual Basic Editor.…I'll press Alt + F11.…So here I am.…If I want to create a new code module,…I go to the Insert menu,…and click Module.…
And here I have my code module.…Any code module that you create using this method,…starts with Option Compare Database.…And what that does is take a look at the database…to see if there are any changes…that the code needs to account for when it runs.…So that's there automatically and you shouldn't delete it.…In this code module,…you can create subroutines or functions.…I'll create a subroutine…that starts with the keyword Sub.…And I'll just call it Hello.…
We don't need to send or pass any information…to the subroutine.…So I'll just time an open and close parenthesis,…and press Enter.…You'll notice that Access…
- 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.