Prev | Current Page 2122 | Next

Michael R. Groh, Joseph C. Stockman, Gavin Powell, and Cary N. Prague

"Access 2007 Bible"

Double-click on the mcrHelloWorld macro to run it.
You??™ll see the same message box that displayed when you ran the macro from the design window.
Assign a macro to an event
When creating macros, you probably don??™t want end users using the Navigation Pane to run
them ??”or worse, running them from the macro design window. Macros are intended for you to
automate your application without writing VBA code. In order to make an application easy to use,
assign your macros to an object??™s event. The most common event to assign a macro is a button??™s
OnClick event. Follow these steps to create a form with a button that runs mcrHelloWorld:
1136
Professional Database Development Part IV
1. Click the Create tab on the ribbon, and click on the Form Design command in the
Forms group.
2. In the form??™s Design ribbon, unselect the Use Control Wizards option in the
Controls group.
For this example, you don??™t want to use a wizard to decide what this button does.
3. Click the Button control and draw a button on the form.


Pages:
2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134
sala konferencyjna Łódź cellulit katowice Hotel Kraków bilety lotnicze nośniki danych