IT tutorials
 
Office
 

Microsoft Access 2010 : Running an Access Macro

- How To Install Windows Server 2012 On VirtualBox
- How To Bypass Torrent Connection Blocking By Your ISP
- How To Install Actual Facebook App On Kindle Fire
10/17/2011 5:25:45 PM
You have learned quite a bit about macros but haven’t yet learned how to execute them. This process varies depending on what you’re trying to do. You can run a macro from the Macro Design window or by double-clicking the macro in the Macros Group of the Navigation Pane, triggered from a Form or Report event, triggered from a Data Macro, or invoked by selecting a custom Ribbon button.

Running a Macro from the Macro Design Window

A macro can be executed easily from the Macro Design window. Running a macro without groups is simple: Just click Run in the Tools group of the Macro Tools Design tab. Each line of the macro is executed unless conditions have been placed on specific macro actions. After you click the Run button of mcrOpenCustomerList (shown in Figure 10.12), the Customer List form is opened.

Figure 1. Running a macro from the Macro Design window.

From Macro Design view, you can run only the first submacro in a macro. To run a macro with submacro, click Run from the Tools group on the Macro Tools Design page to execute the first group in the macro. As soon as the second submacro is encountered, the macro execution terminates.


Running a Macro from the Macros Group of the Navigation Pane

To run a macro from the Macros group of the Navigation Pane, follow these two steps:

1.
Scroll down to the Macros group in the Navigation Pane. If the Macros group does not appear in the Navigation Pane, you will need to select All Access Objects from the Navigation Pane drop-down and then expand the Macros group.

2.
Double-click the name of the macro you want to execute, or right-click the macro and select Run.

If the macro you execute contains submacros, only the macro actions within the first group are executed.



Triggering a Macro from a Form or Report Event

Sometimes you are going to execute a macro in response to an event on a form or report. Examples are a form opening, someone clicking a command button, or a form closing. Here, you learn how to associate a macro with a command button.

The form in Figure 2 illustrates how to associate a macro with the Click event of a form’s command button. Four steps are needed to associate a macro with a Form or Report event:

1.
Select the object you want to associate the event with. In the example, the cmdCheckGender command button is selected.

2.
Open the Property Sheet and click the Event tab.

3.
Click the event you want the macro to execute in response to. In the example, the Click event of the command button is selected.

4.
Use the drop-down list to select the name of the macro you want to execute. If the macro has submacros, make sure you select the correct submacro subroutine. In the example, the macro mcrPersonalInfo and the macro name GetGender have been selected. Notice the period between the name of the macro and the name of the macro name submacro. The period is used to differentiate the submacro (mcrPersonalInfo, in this case) from the macro name (GetGender, in this example).

Figure 2. Associating a macro with a Form or Report event.
 
Others
 
- Microsoft Visio 2010 : Publishing Visio Diagrams to the Web
- Microsoft Word 2010 : Creating a Word Document with Excel Data
- Microsoft Word 2010 : Working with XML Data
- Microsoft PowerPoint 2010 : Broadcasting a Presentation
- Microsoft PowerPoint 2010 : Packaging a Presentation on CD
- Microsoft Excel 2010 : Saving a Workbook
- Microsoft Excel 2010 : Getting Help While You Work
- Microsoft OneOnte 2010 : Storing Your Notes - Password-Protecting a Section
- Microsoft OneOnte 2010 : Revisiting and Restoring a Different Version of a Page
- Microsoft OneOnte 2010 : Creating Subpages for Page Groups
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
programming4us programming4us
 
Popular tags
 
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8 BlackBerry Android Ipad Iphone iOS
Celebrity Style, Fashion Trends, Beauty and Makeup Tips.