One of the most common ways to run an Access macro is by creating a command button. In this video, learn how to run a macro by clicking a command button.
- [Instructor] Access macros run…when a trigger event occurs.…By far the most common trigger is for a user…to click a command button or a quick access toolbar.…In this movie I will show you how to run a macro…in both of those cases.…I have opened the course database…and you'll notice that I have an Open Customers macro…that will open the customers form.…So that's in place, and that's what we'll run…when we create the command button.…I'll put the command button on a new blank form.…
So I'll click the Create tab on the ribbon…and click Form Design and that opens a blank form…in design view.…I won't worry about adding labels or design,…I'll just go up to the design contextual tab of the ribbon…and click the button icon,…and then click in the Detail section.…So there I have command button zero.…Now I can assign a macro to this button.…I need to click Miscellaneous,…and then in the Actions panel, click Run Macro.…
Now click Next.…Which macro do I want to assign?…Well, there's only one here unless you've created others,…
- 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.