O'Reilly logo

Access™ 2007 Bible by Gavin Powell, Joseph C. Stockman, Jennifer Reardon, Michael R. Groh, Michael R. Irwin, Cary N. Prague

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 36. Using Access Macros

IN THIS CHAPTER

  • Understanding macros

  • Looking at the Hello World macro

  • Working with multiaction macros

  • Using macro names

  • Making decisions with conditions

  • Using temporary Variables

  • Handling errors

  • Debugging macros

  • Understanding Embedded macros

  • Comparing Macros to VBA

  • Converting macros to modules

Macros have been a part of Access since the beginning. As Access became more of a development tool, the Visual Basic for Applications (VBA) programming language became the standard in automating database applications. Macros in previous versions of Access lacked variables and error handling, which caused many developers to abandon macros altogether. Access 2007 adds these capabilities, as well and a few others, which makes macros a better alternative to VBA than in previous versions. If it's a slow day and you don't feel like writing VBA code, or if you aren't a VBA guru but still want to customize the actions that your application executes, then building structured macros is the answer.

Note

This chapter uses a database named Chapter36.accdb. If you have not already copied them onto your machine from the CD, you'll need to do so now. This database contains the tables, forms, reports, and macros used in this chapter.

Understanding Macros

A macro is a tool that allows you to automate tasks in Access. It's different from Word's Macro Recorder (described in Chapter 22), which lets you record a series of actions and play them back later. Access macros let you perform defined actions ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required