IT tutorials
 
Office
 

Microsoft Access 2010 : Running an Access Macro

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Product Key Free : Microsoft Office 2019 – Serial Number
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
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us