Learning Microsoft Access 2007 - Macros
Learning Microsoft Access 2007 - Macros
Learning Microsoft Access 2007 - Macros
By Greg Bowden
Chapter 9
Using Macros
www.gct.com.au
© Greg Bowden
Every effort has been made to ensure that images used in this
publication are free of copyright, but there may be instances where
this has not been possible. Guided Computer Tutorials would
welcome any information that would redress this situation.
Chapter
9
Using Macros
Macros are a time-saving feature within Microsoft Access. Many steps that are
frequently used can be stored in a MACRO and the macro can be reused as often as
required. You can also set a button to run a macro.
Your task for this activity is to create some macros for a simplified database for a real
estate company. The database is similar to the one you used in Chapter 8, however,
the queries to separate the rental, sale and auction properties have been removed.
Macros will be used to separate data within the database.
NOTE: i The MACRO NAME column is used to name the different macros.
ii The ACTION column is used to enter the commands of the macro.
Those commands are executed in the order that you enter them.
iii The ARGUMENTS column stores the options that control the way
the action operates.
iv The COMMENTS column is used to enter a description of the
command. It helps you to remember the purpose of the command
at a later date.
NOTE: You can also press the H key to insert the action. The HOURGLASS
command places the HOURGLASS cursor on the screen as the macro is
operating. It lets the user know that the computer is doing something.
NOTE: i The REPORT NAME box is used to select the required report.
ii The VIEW box indicates whether the report is to be printed directly,
previewed or set to design view.
iii The WHERE CONDITION box is telling the macro to look in the
PROPERTY DETAILS table and find all the records where the SALE
TYPE field contains the word RENT. The table name and field name
must be separated by an exclamation mark (!).
iv You can use the EXPRESSION BUILDER icon at the right of the WHERE
CONDITION box to build the condition if you prefer.
v The ARGUMENTS that you set are stored in the ARGUMENTS column.
5 When you select OK the RENTAL PROPERTIES report should be opened and
maximised. Close the preview to return to the form.
NOTE: i A button can be set to run a macro as you will see shortly.
ii You can also use macros to open tables or queries.
9-10 © Guided Computer Tutorials 2008