O'Reilly logo

Access™ 2007 VBA Programmer's Reference by Armen Stein, Geoffrey Griffith, Rob Cooper, Teresa Hennig

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

3.6. Embedded Macros

Developers used to campaign loudly against macros because one little error could shut down an entire application. Now, macros can be embedded in events for forms, reports, and controls and are often an effective replacement for some VBA code. An embedded macro becomes part of the parent object and is not visible in the Navigation pane. Embedded macros can run in disabled mode, and they include error handling and debugging, can be combined into groups, and can use temporary variables. Okay, before anyone has a heart attack about perceived risks, I'll add the caveat that unsafe macro actions are blocked in disabled mode, which means that they would not allow embedded macros to run such tasks as File system interactions. But the big picture is that not only can macros save time, but they can avoid a lot of hassles associated with deployment and trusting files.

When you combine embedded macros with the new features in 2007, you can create robust solutions with little or no VBA code. Before you scoff at the potential functionality, realize that Access 2007 templates deliver all their features, program integration, and a polished interface using macros instead of VBA code. Developers need not panic—there's still plenty of need for VBA code. For one thing, somebody needs to create all of the new macros, and who knows the business rules and needs better than a developer? When you think about it, the real purpose of a developer is to understand the business model and ...

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