Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Automating the workflow with macros

From: Access 2010: Forms and Reports in Depth

Video: Automating the workflow with macros

Before we wrap up this course, I thought it will be helpful to outline a couple of the macros that you can build that will help you connect your forms to your reports. As we have seen in several places throughout Access, sometimes the wizards only present you with the most common options. To get access to all the available options, you will need to dig into the designers. The same applies to the button wizard. The actions available in the button wizard only give you a few basic options, to move beyond that, we need to construct macros ourselves. So let's add some of these reports that we have created in the last two chapters, to the Main Menu that we created earlier in the course.

Automating the workflow with macros

Before we wrap up this course, I thought it will be helpful to outline a couple of the macros that you can build that will help you connect your forms to your reports. As we have seen in several places throughout Access, sometimes the wizards only present you with the most common options. To get access to all the available options, you will need to dig into the designers. The same applies to the button wizard. The actions available in the button wizard only give you a few basic options, to move beyond that, we need to construct macros ourselves. So let's add some of these reports that we have created in the last two chapters, to the Main Menu that we created earlier in the course.

I will right click on the Main Menu and switch into Design View. We will go up to that Button command and we will add a button to our form. I will click here to add it and I'm going to go to Report Operations. The first one I want to do is Mail Report. I will go ahead and say Next. The report I want to mail is that Orders By State, I will go ahead and click Next. And for this button I wanted some Text on here. I'm going to put Email Orders Report, go ahead and say Next, it will accept that name and say Finish. So there's one button. Let's go ahead and add one more.

I will click on the Button control and add that down to my form, the wizard will start and I am going to go to Report Operations again, and this time I am going to choose Send Report to File. Go ahead and say Next, the report I want to send is my Lifetime Sales report. I will click on Lifetime Sales and say Next. The text for this instead of just Report to File, we will say Export Lifetime Sales. Go ahead and say Next and Finish. So now I have got two buttons here, well let's take a look at what the wizard made for us. I will click on this first one the Email Orders one.

We will go to the Event tab here. The On Click event is this Embedded Macro and I will click the Build button to edit it. I will see that the wizard created this macro for us that that includes this EmailDatabaseObject action. It filled in a couple of these options for us, for instance, I have the option to include a report in the Orders By State report. But I also have some additional choices. I can specify an Output Format. And if I click on this, then the drop-down menu here I can choose a specific file format so that Access doesn't ask me every time I press the button, what type of file I would like.

I am going to choose PDF. I can specify a recipient so I could type in the To box here. And I am just going to send this to Test@test.com. I can specify carbon copy or blank carbon copy recipients, I can type in a subject here, Here is the Orders by State report. And I can add Message Text in to the body, The report is attached. This last one here, this Edit Message one is currently set to Yes. If I leave it set to yes and press that button, Access will take this report, it will convert it to a PDF file.

It will open up Outlook on My Computer, it will create a new e-mail, address it to this person, put in the Subject line and the Message Text, and attach that PDF file. And then it will sit there and wait for me to send the email. If I change Edit Message to No here, when I click on that Send Email button on my Main Menu, all of that will package up, get attached to the email, get addressed and it will be send off with no further interaction on my part. So I won't even see that email go out, it will just be gone. Let's go ahead and change that back to Yes. So I don't accidentally send any emails.

We will go ahead and close this and we will save the macro. So now that macro is providing more functionality than what the wizard gave for us. Let's take a look at the other one, this Export Lifetime Sales. The On Click event is this Embedded Macro again. We will look at the builder for that. This macro includes the ExportWithFormatting action, and again I have got a couple of options filled in. If I click here, I can select some additional options. Once again, I can specify a file format. Maybe I want to export this in a Excel file. I can also specify an Output Location, so if I want to specify an archived folder on a network or some place on my local computer where I always want to save it, I could type that in here, so Access won't even asks me for it when I click the button.

It will just put it right in that spot. I am going to leave it blank for now, and click close. I will save the changes, so again, now this button is doing something more useful than what the wizard left us off with. Let's go ahead and format these a little. I will click here and here, we will go to Format, I will change their Quick Style to maybe this black and we will go ahead and Arrange them. I will Align them to the Left side, I will take their spacing and Decrease Vertical and maybe a couple of times. That's actually going to take too long so I am going to press the button move it up here.

Now I will select both of them and maybe I will drag them down here. So now I have got a couple of additional buttons that I have added to my Main Menu. I can go take a look at it. I will press to switch to Form View and now if I press this Email Orders Report button, we will see what happens. The order gets packaged up and in just a moment, we shall see Outlook pop-up, there it is, my email is formatted, the file is attached and it's ready for me to press Send. So while using the Button Wizard, was able to get us started, digging into the full macro editor, was able to provide further functionality.

Show transcript

This video is part of

Image for Access 2010: Forms and Reports in Depth
Access 2010: Forms and Reports in Depth

38 video lessons · 14428 viewers

Adam Wilbert
Author

 
Expand all | Collapse all
  1. 1m 27s
    1. Welcome
      1m 2s
    2. Using the exercise files
      25s
  2. 15m 53s
    1. Introducing forms
      2m 41s
    2. Designing for the end user
      45s
    3. Exploring the database
      1m 49s
    4. Creating a form with the Form Wizard
      6m 43s
    5. Refining the form in Layout view
      3m 55s
  3. 24m 33s
    1. Organizing the form elements
      7m 14s
    2. Formatting
      4m 48s
    3. Modifying the form through its properties
      6m 56s
    4. Adding a header and some polish
      5m 35s
  4. 1h 2m
    1. Introducing form controls
      3m 48s
    2. Using lines and rectangles
      2m 48s
    3. Organizing screen space with tabs
      4m 47s
    4. Adding buttons
      5m 3s
    5. Linking to external content
      4m 15s
    6. Entering and selecting data
      5m 8s
    7. Controlling input with option groups
      6m 0s
    8. Attaching documents
      6m 49s
    9. Attaching images
      5m 8s
    10. Understanding the subform control
      4m 13s
    11. Adding charts
      7m 9s
    12. Linking controls
      7m 41s
  5. 21m 42s
    1. Creating the main menu
      8m 49s
    2. Adding a splash screen with startup options
      5m 35s
    3. Creating a customer form
      7m 18s
  6. 45m 20s
    1. Grouping and sorting data
      4m 36s
    2. Understanding report structure
      6m 12s
    3. Building reports from wizards
      5m 0s
    4. Building reports from queries
      6m 34s
    5. Formatting conditionally
      6m 59s
    6. Calculating fields
      4m 35s
    7. Adding the finishing touches
      4m 49s
    8. Populating pre-printed documents
      6m 35s
  7. 15m 8s
    1. Printing reports
      3m 6s
    2. Tweaking the design
      7m 10s
    3. Automating the workflow with macros
      4m 52s
  8. 58s
    1. Next steps
      58s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now "Already a member? Log in

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.


Mark all as unwatched Cancel

Congratulations

You have completed Access 2010: Forms and Reports in Depth.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

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.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.