Automating Tasks with Macros
Use Access macros to automate repetitive work without writing code, and understand where automation genuinely pays off.
By the end of this lesson you can
- Explain what an Access macro is and how it differs from VBA
- Build a macro that opens a form and applies a filter
- Attach a macro to a command button
- Judge which tasks are worth automating
Lesson Notes
Read through the key concepts before you try the challenge.
Automation earns its keep on repetition
You support daily operations at Lakeside Medical Associates.
Every morning the front desk performs the same nine steps: open the database, open the appointments form, filter to today, sort by time, and open the check-in form. Nine steps, five staff, every day. Two of them do it slightly differently, and one regularly forgets the filter and works from yesterday's list.
Your task: Reduce a nine-step routine to one button, so it is both faster and impossible to do inconsistently.
An Access macro is a stored sequence of actions built from a list rather than written as code. You choose actions such as OpenForm, ApplyFilter, or GoToRecord and set their arguments, and Access performs them in order. No programming is required.
The consistency benefit usually exceeds the time saving. A macro performs the same steps in the same order every time, so the staff member who forgets the filter no longer can. Automation that removes a category of human error is worth more than automation that saves thirty seconds.
| Action | Does |
|---|---|
| OpenForm | Opens a form, optionally filtered to specific records |
| OpenReport | Opens or prints a report |
| ApplyFilter | Filters the records shown |
| GoToRecord | Moves to a specific record — new, next, last |
| SetValue | Sets a control or field to a value |
| MessageBox | Displays a message to the user |
| RunQuery | Runs a stored query |
| CloseWindow | Closes a form or report |
| Consideration | Macros | VBA |
|---|---|---|
| Learning curve | Low — pick actions from a list | Higher — a real programming language |
| Conditional logic | Basic If conditions | Full control flow |
| Error handling | Very limited | Proper error handling |
| Looping through records | Not practical | Straightforward |
| Best for | Navigation, opening objects, simple automation | Data manipulation, validation, complex logic |
A five-step daily routine is performed by five staff, two of whom do it slightly differently. What is the strongest argument for automating it with a macro?
Challenge
Apply what you've learned in this lesson.
Automate something you actually repeat.
- Write down every step of a routine you perform in your database more than once a week. Number them.
- Build a macro reproducing those steps using OpenForm, ApplyFilter, and any others you need. Run it and compare the result against doing it manually.
- Add a command button to a form and attach the macro to its On Click event. Test it three times.
- Write two sentences on which step of the routine was most error-prone by hand, and how the macro removes that risk.
Finished this lesson?
Progress is saved in this browser only. It is not a grade — official progress lives in Brightspace.