Microsoft Office Tutorials and References
In Depth Information
Introducing Macros
You can edit your macro by right-clicking the macro name in the Navigation
Pane and choosing the Design View option from the contextual menu. You
see the macro again in its own tab or window. When the macro is open in
Design view, you can change actions and arguments as described in the
following sections.
Taking action
To tell Access what to do when running the macro, you specify actions and
arguments. Access provides dozens of actions that you can use in your
macros. Table 1-1 lists some common macro actions.
Table 1-1
Macro Actions
Action
Comments
Apply Filter
Applies a filter to the records in a datasheet, form, or
report. Set the Filter Name argument to the name of
an existing query, or type an SQL WHERE statement as
the Where Condition argument.
Beeps. (You were perhaps expecting it to do something
else?)
Beep
Closes an Access object.
CloseWindow
Repeats the last search you performed (perfect for a
Find Next button on a form!).
FindNextRecord
Searches the current datasheet or form for the record
you specify.
FindRecord
GoToControl
Moves the focus (cursor) to the control you specify. This
action is useful on forms.
MessageBox
Displays a message box with the text you specify.
OpenForm
Opens a form in Form or Design view or in Print Preview.
Opens a query in Datasheet or Design view or in Print
Preview.
OpenQuery
OpenReport
Opens a report in Design view or Print Preview or just
prints the report, depending on what you specify for the
View argument.
OpenTable
Opens a table in Datasheet or Design view or in Print
Preview.
PrintPreview
Displays the object that you specify in Print Preview. From
there, the user can choose whether and what to print.
Requery
Recalculates the value of the current control or reruns
the record source query.
RunCode
Runs a VBA function (see Book VIII).
Search JabSto ::




Custom Search