Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
An AutoExec macro is a macro that runs the moment you open up the database file. That allows you to automate your repetitive tasks. For example, every morning there's a report that I like to run. Sometimes I like to view it and sometimes I like to print it. There are also several forms that I use day in and day out. Creating a macro that opens up all of these objects will save me precious seconds every morning. To create the macro, go to the Create ribbon and on the right-hand side choose Macro. My first action will be to open up my morning report.
So I'll use the dropdown, scroll down, and OpenReport. The report that I want to open is my Orders by Customer Report. I can open it in Report View, but I also have the option of sending it straight to the printer or opening up in Print Preview to give me the option of viewing it or printing it. My next step will be to open up one of my forms. I'll click Open Form and I'll choose my Customers Order Form since I use that every day. The other form I use is for my Sales Reps.
So I'll click on the dropdown, click on Open Form again, and this time, choose my Sales Reps and customers Form. I'll close my macro and Save it. Now here's the crucial part, you have to give this macro the named AutoExec. That's what tells Access to run it the moment the file is opened. I'll click OK. I'll go up to the File tab and close the database. Now when I open it again three things happen.
It opened up my Sales Rep and Customers Form. It opened up my Customers Orders Form, and there's my morning report ready either to be printed or just to be viewed. Creating an AutoExec macro to automate your repetitive tasks will save precious minutes off every morning.
Get unlimited access to all courses for just $25/month.Become a member
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.