Introduction.
The only difference between stand-alone macros and embedded macros is that embedded macros do not appear in the Navigation Pane under the Macros group. Instead, they are written directly within a Form, Report, or a control’s event property. When you copy a Form or Report, its embedded macros are copied along with it.
Let’s now explore how embedded macros are created.
Creating Embedded Macros.
Open Microsoft Access 2007.
Open a Report in Design View.
Press F4 or Alt+Enter to display the Property Sheet of the Report.
Click on the Event Tab of the Property Sheet.
Click on the On Load Event Property to select it.
Click on the Build (...) button on the right side of the property.
The Macro Builder option is already in the selected state. Click the OK Command Button to accept it.
The Macro is open in Design View. The title bar of the macro indicates Catalog:Report: On Load (the Report Name: Object Type: Event Type), where the macro will be embedded.
Select MsgBox Action and type my Embedded Macro in the Message Action Argument.
Type On Load Info in the Title Argument of MsgBox Action.
Click on the Close Toolbar button to save and close the Macro.
Save and Close the Report.
Right-click on the Report in the navigation pane and select Open to open the Report in Report View. The embedded macro will run, and you will see the message.
You can modify the macro by following steps 2 to 6. You can add several actions in the Macro if needed.











No comments:
Post a Comment
Comments subject to moderation before publishing.