Step #4 - Begin Building Macro to Initiate Database Refresh
1. Create New Macro
2. In Macro's Design View, enable to the following Design tools (located in Macro Tools/Design tab):
- Show All Actions (Only in Access 2007)
- Conditions
Refer to the following screenshot for visual:

Please make note of all the different areas in the Macro screen for future reference.
3. In the Action column on Row 1, type: MsgBox
- Update the MsgBox's Action Arguments per the following screenshot:

4. Next, in the Action column on Row 2, type: MsgBox
- Update the MsgBox's Condition Statement to:
Code:
MsgBox("Do you want to continue with Stocks Database Refresh?",4,"Microsoft Access Forums")<>6
- Then, update the MsgBox's Action Arguments per the following screenshot:

5. Next, in the Action column on Row 3, type: StopMacro
- Update the StopMacro's Condition Statement with three periods: ...
Refer to the following screenshot for visual:

6. Next, in the Action column on Row 4, type: Hourglass
- Ensure the Hourglass' Action Arguments (Hourglass On) is set to: Yes
7. Next, in the Action column on Row 5, type: SetWarnings
- Ensure the SetWarnings' Action Arguments (Warnings On) is set to: No
8. Save the Macro and name as: mcrRefreshDatabase
The attached Access 2007 database (inside zip file) is what you should have.
Towards the end of this tutorial, we will be running the Macro from a command button on a form. In the meantime, feel free to double click the Macro to see how it runs. Besides initiating the database refresh process, the Macro (this far) gives the user the opportunity to cancel the Refresh process. We want to make absolutely sure, this is what the user intends to do.
We will come back to this Macro and continue to build on it as we go through the rest of the tutorial.
Continued...
-RC