Microsoft Office Tutorials and References
In Depth Information
Chapter 1: Making Macros Do the Work
Chapter 1: Making Macros
Do the Work
In This Chapter
Seeing what macros do
Creating a macro
Understanding macro actions and arguments
Running macros
Telling Access to trust the macros in your databases
Making macros run conditionally
Access is a pretty smart program. Throughout the program are
thousands of nice little features that make Access intelligent, such as
validation rules and formats that help you keep your data neat and tidy.
Sometimes, however, you want Access to be even smarter. You may want to
format a field in a way that Access doesn’t allow, for example, or you may
want your form to include a command button that the Command Button
Wizard doesn’t make. No problem — you can make Access even smarter by
writing your own programs within Access.
Strangely, Access includes two (count ’em) ways of putting a program
together: macros and Visual Basic for Applications (VBA). The differences
between the two are
Macros are the original Access do-it-yourself program makers, dating
back to the Dawn of Access (1991). The macro language is limited,
however, and Microsoft suggests that you not use macros for any major
programming tasks.
VBA is the standard programming language for Microsoft Office and
other applications. VBA is a version of Visual Basic that’s similar to
VBScript, which works on the web. Microsoft recommends that you use
VBA for all significant programs. We describe VBA in detail in Book VIII.
So why use macros at all? Here’s why: If you want to do something small
and simple, making a little macro is a piece of cake (as you find out in this
chapter). Also, you can always convert the macro to VBA later with the
Access conversion command. This chapter explains how to make
standalone, general-purpose macros, whereas Chapter 2 of this minibook covers
data macros (macros that are stored as part of a table) and macros that are
embedded in forms and reports.
Search JabSto ::

Custom Search