Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Macros are series of actions that can be triggered by data entered, or buttons on forms. They're incredibly useful for automating your database. Macros are very complex, and an entire course could be written just on this topic. In this lesson, I'll introduce you to the Macro Designer, and we'll create one basic action. We'll create a Macro that will open an order form and move to the Customer field within it. To create a Macro, click on the Create button and then click on Macro, on the far right. The Macro Designer window opens. There's one Action field to get you started, and here's a button to toggle on and off the Action Catalog, which lists all the available macros.
If you click on Show All Actions, you'll see additional Macros here beyond the basic set. We want the command OpenForm. Instead of searching around to find it, I can click in Search right here and type Open, and it will bring up all the Macros that use open in the title. We want OpenForm. I can either drag it into my Macro or double-click on it. The Macro appears with all the parameters and arguments it needs to run. The form I want to open is the Orders Subform.
Use this dropdown to find it. The view that we want is form. We are not going to add in any filters or conditions. The Data mode allows you to choose whether it's going to open up in Add - which will start with the blank record, Edit - which will show you all the records so that you can change them, or Read Only - so you can view the data but not make any changes to it. We want Add, and then our Window mode will be Normal. Now, run the Macro and see what it does.
Come up here to the exclamation point. When it asks you to save, say Yes. And we're going to call it, in all lowercase letters, neworder, and then click OK. So now we have an open orderform, but it would be handy to have it skip down to the Customer field, since the Order field will Auto Fill, and the Date will usually be correct. So let's right-click and close this form and go back to our Macro, and in the dropdown under the first step, let's create a second step.
Click on it, scroll down and choose GoToControl. Remember from the Forms lesson that a control is a field on the form. Enter in a square bracket, and type "Customer," the field on the form. Save the Macro again. Go back to the Design Tab and run it. And it opens up the orderform and jump straight down to the Customer field. In the next lesson, we'll see how to activate that Macro in the database.
Macros are a complex but powerful way of forcing Access to do your bidding, allowing you to program desired actions for a variety of triggers.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 74663 Viewers
80 Video lessons · 129819 Viewers
52 Video lessons · 64023 Viewers
59 Video lessons · 49813 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.