Access Macros  «Prev  Next»

Lesson 6Looking at other useful macro actions
ObjectiveWork with some other useful macros that are available in Access.

Looking at other Useful Macro Actions

We have touched on some of the macro actions that you will be using most often. Now, in this lesson I would like to show you some other useful macro actions, explain what they do, and where you will likely use them. To do that, take a look at the following table:

Macro Action Purpose Where Used
Beep Makes a beep Whenever you want to get the user’s attention; To signal the end of a process; or if you are using the MsgBox macro action, which has an argument to beep for you
Close Closes objects Useful for creating a close command button on forms
CopyObject Copies Access objects from the current database to itself or another database Good for when you want to make a backup table before running a query that makes major changes to the data
DeleteObject Deletes objects from the database Good for deleting temporary tables
Echo Turns off all displays to the screen Useful when you are making a lot of changes and don’t want the screen to flash (Use with caution. As with SetWarnings, be sure to turn Echo back to Yes when done.)
HourGlass Displays an hourglass for the cursor Nice to use when you have a long query running and you don’t want the user to think they can just do other things; the hourglass encourages them to wait until the query is complete
Maximize Maximizes a form Great in the OnOpen event of a form; use the Restore command in the OnClose of a form to restore the form
MsgBox Displays a message box with many options Used for displaying a message to the user
OutputTo Outputs an Access object to another file Great when you need to send a report or data to someone in another file format such as Excel or Text
Quit Quits a database application Good choice for a switchboard command button so the user can get out of the database

These are just a few of the useful macro actions you can use. Play with some of them to get used to them.
For now, check out this matching applet to get some practice.
The next lesson is the module wrap-up. You will get a brief review of the topics you have covered in this module. Also, you can take a quiz that will help you verify what you have learned and discover topics that you might want to review in a more detailed manner.
The following section gives you advice on how to practice working with macro actions and recognize their purposes.

Microsoft Access Database Actions

The folllowing is a reference list of actions or commands from Microsoft Access.
  1. Beep
    • Purpose: Produces a simple sound or tone.
    • Common Usage: Used in macros or VBA scripts to alert users when a process is completed or an error occurs.
  2. Close
    • Purpose: Closes a specified object, such as a form, report, or table.
    • Common Usage: Automates the closing of objects once they are no longer needed.
  3. CopyObject
    • Purpose: Creates a duplicate of an Access object, which can be pasted into the current or another database.
    • Common Usage: Helps in duplicating forms, reports, or tables for backup, modification, or reuse in another database.
  4. DeleteObject
    • Purpose: Removes an object from the database.
    • Common Usage: Often used in scenarios where cleanup of unnecessary or temporary objects is required.
  5. Echo
    • Purpose: Temporarily disables screen updates to enhance performance during batch operations.
    • Common Usage: Prevents screen flickering during the execution of macros or VBA code.
  6. HourGlass
    • Purpose: Changes the cursor to an hourglass symbol, indicating that a process is running.
    • Common Usage: Used to inform users to wait while a long-running process completes.
  7. Maximize
    • Purpose: Expands a form to full size.
    • Common Usage: Ensures that a form utilizes the maximum screen real estate for better user visibility.

  • Use Action Buttons to perform various Tasks
    Access App
    Microsoft Access App

    When you create or use a Microsoft Access app, you use the action buttons to perform various tasks such as add, modify or delete the records. Actions are somewhat like the controls on a form. Some actions are predefined which cannot be changed or deleted but you can add custom actions to suit your application needs. Each view in an Access application displays specific predefined actions that can be performed from that view. This article gives you an overview of the predefined actions and explains how you can add custom actions to a view. If the Action Bar on which the actions are displayed is hidden by the app developer, the actions are not visible and if the record source is set as read only, the actions will not be available as you will only be able to view the data.

SEMrush Software