|
|
Step Number 1Now, we are going to go through the process of creating a simple macro. First, make sure that your database window is open and that Macros is selected. Click on the New button. Step Number 2The macro design window should appear. It will look like the one below. A macro is a sequence of actions that are stored so that they can be performed again and again. Step Number 3In the first line of the Macro Editor window, select RunCommand from the drop down list. In the list box at the bottom, select Exit. This simple macro will now allow you to exit from Microsoft Access. Step Number 4Next, go to the File menu and select Save As. Step Number 5Now, exit the Macro editor and open the Main Switchboard form in design view. Step Number 6You should see the screen below. Go ahead and place a label on the form and set its caption to Exit Program. Step Number 7Now we will Add a command button to the form. This button will run our macro for us. The command button wizard should appear once you have added the button to the form. In the left hand list box, select Miscellaneous and then select Run Macro from the list on the right. Then click Next. Step Number 8Next, select macEnd from the list of Macros in this step (since it's the only one, it is a rather obvious choice). Click Next Step Number 9Now, we need to select a picture from the list. I picked the picture titled Exit, but you may choose another if you have one that is more appropriate. After you are finished choosing a picture, click Next to continue. Step Number 10Now, name the command button something meaningful, like cmdExit and click Finish. If you open the switchboard now and click on the exit button, it should completely close Access. See how easy it is to create a macro to automate repetitive actions! |