Video: Using data macros

A Data Macro allows you to perform an action upon adding, updating, or deleting a record. When a customer's order is marked as complete, it would be nice to automatically send them an e-mail letting them know their olive oil has been shipped. To do this, open up the Orders table. Go up to the Table tools Ribbon and choose Table. Then click on After Update. A Macro window will open. In the first box, select If and type in a square bracket to start a field name and start typing OrderStatus.

In Access 2010 Essential Training, Alicia Katz Pollock gives a comprehensive overview of creating databases in Access 2010, whether using predefined database templates or building from scratch. This course covers each step of constructing and modifying databases for custom purposes, as well as working with tables, forms, queries, macros, and reports and charts for record keeping and analysis. Exercise files are included with the course.

Using data macros

A Data Macro allows you to perform an action upon adding, updating, or deleting a record.When a customer's order is marked as complete, it would be nice to automaticallysend them an e-mail letting them know their olive oil has been shipped.To do this, open up the Orders table.Go up to the Table tools Ribbon and choose Table.Then click on After Update. A Macro window will open.In the first box, select If and type in a square bracket to start a field name andstart typing OrderStatus.

You'll get a little dropdown with the possible matches in your database.We'll go ahead and double-click on OrderStatus, and it puts it in there.Type in = "complete".The quotation marks show that it's a text value.In the next box down, choose SendEmail.A box with parameters will open.In the To field, type in square bracket, Customers!, another square bracket, and EmailAddress and end the bracket.

The first one tells us to look in the Customers table. sSparated by theexclamation point and EmailAddress refers to the field.Now, let's set up our e-mail.In the Subject line, type in "Your Two Trees Olive Oil has been shipped."Then tab down to the Body of the message and type in "Your order has been shipped.Please let us know when it arrives and how you like it."When you are done typing, click Save and then Close.Let's test this out.

Go to the bottom of your Orders Form and click the new blank record button.It will start a new record.Tab over, pick a customer, pick a product, enter in a Quantity,then tab pass Processed to enter it in the first time.Now, let's say our order has been shipped.We'll drop down Processed and change it to Complete.When I tab off of the order, it opens up a box saying, A program is trying tosend an e-mail message on our behalf.Click on Allow, and it will now send an e-mail to our customer.

Data Macros are a great way of automating tasks based on adding, updatingor deleting records.

Q: It seems there are movies missing in the course which should explain how to enter products in the Order table. How do I do this?

A: The lessons in this course are only somewhat cumulative. The database is built throughout the title before getting to the relationships and referential integrity, but not every step is shown. This is one of those courses where using the exercise files is recommended. The course would be very long and repetitive if I demonstrated the same technique over and over for every step in building a database.

Take a look at these videos instead.

Chapter 2: Planning and designing your database (concept)

Chapter 2: Creating and editing tables in design view (building the order table)

Chapter 2: Creating a lookup field. (This one uses Customer lookup as the example, but I believe this technique answers your actual question. You would use the same procedure to add the field that calls up the list of products.)

Q: In the
Chapter 6 video "Using Design view," we work with the Combo Box
Wizard. When I click on the Combo Box then click the location on the form, it
does not start the Combo Wizard. Please advise.

A: Click on the Data tab and make sure one of the tables or queries appears selected in the Control Source. The form needs to be bound to a table or query before you make the combo box.

Also, Access is extremely finicky. When you're looking at the Properties window, be sure to click in the little box in the upper left corner of the form, between the vertical and horizontal rulers—as noted in the screenshot—before creating the combo box.

Q: It seems there are steps missing in the course. The file I built
myself by following along doesn't match what's on screen. Why not?

A: The lessons in this course are only somewhat cumulative. Each movie
is a standalone explanation of a technique or feature. The database is
built throughout the course, but not every step between the lessons are
shown. The course would be overly long if the author repeated every step in building a realistic,
functioning database. However, the missing steps are variations on the techniques you've already
learned. Also, this is one of those courses where using the
exercise files is recommended.

Sorry, there are no matches for your search "" —to search again, type in another word or phrase and click search.

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.

Already a member ?

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

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

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:

new course releases

newsletter

general communications

special notices

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:

new course releases

newsletter

general communications

special notices

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