Datasheet
Chapter 1
44
The lower pane of the macro window lists the arguments that you can pass to the PrintOut
action to define exactly how it should operate. For example, we've specified Selection as the
Print Range argument. This causes Access to only print out those records that were selected
when the key combination Ctrl+P was pressed. If we had only wanted to print out the first two
pages of the currently selected object, we could have chosen Pages as the Print Range
argument and then typed 1 as the Page From argument and 2 as the Page To argument.
The caret sign (^) is used to indicate that the Ctrl key is held down at the same time as the
P
key. For more information on these key codes, search Microsoft Access Help using the
phrase "Autokeys Key Combinations".
Carrying Out Actions when a Database is Opened – the Autoexec Macro
When you open up an existing database, the first thing that Access does is to set any options
that have been specified in the Tools/Startup... dialog. After this, it checks to see if a macro
called Autoexec is present. If it is, then Access executes it immediately. This handy feature
allows you to carry out actions such as writing a record to a log file to indicate that your
application has started up.
Users of versions of Access 2.x and earlier should note that many of the conventional uses
of the Autoexec macro have now been replaced by the Startup... option on the Tools
menu. If you're converting an application from a version 2.x or earlier, you may want to
remove the functionality from the Autoexec macro and use the Startup... dialog instead.