Chapter 7. Creating Table Data Macros

In Microsoft Access 2010, you can define a data macro to respond to different types of table events that would otherwise require the use of writing Microsoft Visual Basic code or the creation of macros attached to forms and reports. The unique power of data macros in Access 2010 is their ability to automate responses to several types of table events without forcing you to learn a programming language. The event might be a change in the data, the creation of a new record, or even the deletion of an existing record. Within a data macro, you can include multiple actions and define condition checking so that different actions are performed depending on the values in your table fields or criteria you specify.

As you’ll learn in Chapter 24, “Understanding Visual Basic Fundamentals,” (on the companion CD) you can use Visual Basic to perform any functionality that you can create in a data macro. However, even if you think you’re ready to jump right into Visual Basic, you should study all the data macro actions first. Learning data macros is an excellent introduction to programming in Access in general.

Note

The examples in this chapter are based on the backup copy of the Back Office Software System sample web database (BOSSDataCopy.accdb) on the companion CD included with this book. The results you see from the samples in this chapter might not exactly match what you see in this book if you have changed the sample data in the files. Also, all the screen images in this chapter were taken on a Windows 7 system with the Access display theme set to Silver. Your results might look different if you are using a different operating system or a different theme.

Creating Table Data Macros

In this chapter, you will: