SQLConfiguration SQLConfiguration





Access Macros  «Prev  Next»

Assigning Macros to Controls on a Form - Exercise

Creating a macro and assigning it to an event


Objective: Create a macro and assign it to a command button's OnClick event.

Exercise scoring

You will receive 10 points for this exercise. The exercise is auto-scored; when you have completed the exercise, click the Submit button to receive full credit.

Background/overview

Recall that you are the Access database administrator for the marketing and documentation departments of companies in the software and networking business.
For one of your large clients, you need to create a switchboard for your application.

Download files

As we stated in the first module, the Consulting407.mdb database is available as a compressed download file available on the Resources page. If you've already downloaded the database, continue to work in that version.

Instructions

Using the project database Consulting407.mdb:
  1. Create a new macro group called FormMacros.
  2. Create two macros in the group which open the Clients and Projects forms respectively. Name them OpenClients and OpenProjects.
  3. Save the macro group.
  4. Create an unbound form.
  5. Place two command buttons on the form you just created, with the Caption properties set to Clients and Projects.
  6. Set the OnClick events to the macros created.