Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
Once you've made your Macros, you need them to be triggered in your database. One of the most common methods of activating a Macro is to assign it to a button in a form. Now that we've built a Macro to open an Order form, let's use it in our database. Click on the Queries header to collapse it, so we can see our Forms. We have a Products Split Form. That allows us to look at our products. I can imagine a sales rep looking at this form to see the prices, and wanting to place a customer's order right from here. We can put a button on the Form up, in the header.
That'll open up a blank Order Form. Click up on the View button to toggle it to Layout View, and let's make a place for the button. Click one time on the Product name. Now a button will always fill up the cell that it's in. So we're going to split this cell into three parts. Go up to the Arrange tab and choose Split Horizontally, and it splits it in half. Click on the right half, and Split it Horizontally again. Now we have a perfect place for our button. Go back to the Design tab.
Click on the fourth icon for a Button, and then hold your cursor over that new cell that we created. Click on it, and a Wizard will open up, so that we can choose the action for our button. Click on Miscellaneous, and then Run Macro and then click Next. Choose the name of our Macro, newOrder, and click Next. Now we can either put Text on our button or a Picture. We can click on Show All Pictures to show all the different options that we have, but we're going to use Text.
Click up on Text, and change the button name to Place New Order and click Next. Now we're going to change the button name itself to PlaceOrder. This doesn't show on the form, but you may see it in the programming. Click Finish, and now we have a Button. If you'd like to change its appearance, go to the Format tab and choose Quick Styles, and let's choose this green one down here. We can also choose a shape. Click on Change Shape, and make it a Rounded Rectangle. Let's try it out.
Go back to the Design tab, and to the Form View, and click on Place New Order. The Order form opens and jumps straight to the Customer field. You did it. In addition to buttons, Macros can also be assigned to be triggered when entering data into Forms and Tables. Assigning a Macro to a Button is a great way to trigger it from any form.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 74231 Viewers
80 Video lessons · 129577 Viewers
52 Video lessons · 63854 Viewers
59 Video lessons · 49643 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.