
How to Add a Button in MS Access Form
- Protected_User_4eaaaa7b
- Views : 28,543
Table of Contents
Buttons are the backbone of any functional MS Access form. Whether you want to submit records, run queries, open reports, or navigate between entries — a well-placed button turns a static form into a working tool your whole team can use.
The problem? Most tutorials either skip the “why” entirely or drown you in VBA before you’ve even opened Design View. This guide cuts straight to what matters: adding buttons that actually work, step by step, with every option explained.
Over 95,000 companies worldwide use Microsoft Access, and it still holds a 7.25% market share in Database Management Systems globally. If your team is in that group, mastering form buttons is one of the fastest ways to make your database more usable — without needing a developer.
What Is a Button in an MS Access Form?
A button (also called a Command Button) is a control you place on an Access form that triggers an action when clicked. That action could be:
- Saving or deleting a record
- Opening another form or report
- Running a macro or query
- Navigating to the first, last, next, or previous record
- Closing the current form
Access makes it easy to add these through the built-in Command Button Wizard — no coding required for most use cases. But if you want full control, you can write your own VBA behind any button.
Before You Start: Two Things to Know
Design View is where buttons live. You cannot add controls to a form in Form View or Datasheet View. You must switch to Design View first.
The Command Button Wizard saves time. When you draw a button on your form, Access can automatically launch a step-by-step wizard to assign an action. You can also skip the wizard and write your own code — both paths are covered below.
How to Add a Button in MS Access Form (Step by Step)
Open Your Form in Design View
- In the Navigation Pane on the left, right-click the form you want to edit.
- Select Design View from the context menu.
Your form opens in an editable grid where you can place, resize, and configure controls.
Enable the Command Button Wizard
Before drawing your button, make sure the wizard is active:
- Click the Design tab in the ribbon (under Form Design Tools).
- Look at the Controls group.
- Click the small Use Control Wizards button (it looks like a magic wand icon) — make sure it’s highlighted/active.
If the wizard is off, Access will drop a blank button on the form with no action assigned. Turn it on to get guided setup.
Draw the Button on Your Form
- In the Controls group on the Design tab, click the Button icon (it shows a rectangle with a cursor).
- Move your cursor to the form canvas.
- Click and drag to draw the button in the position you want.
The Command Button Wizard launches automatically as soon as you release the mouse.
Use the Command Button Wizard to Assign an Action
This is where you define what the button does. The wizard organises actions into categories:
Categories and common actions:
Category | Actions Available |
Record Navigation | Go to First Record, Go to Last Record, Find Record |
Record Operations | Add New Record, Delete Record, Save Record |
Form Operations | Open Form, Close Form, Print a Form |
Report Operations | Open Report, Print Report, Preview Report |
Application | Quit Application |
Miscellaneous | Run Macro, Run Query |
Steps in the wizard:
- Select a Category from the left list.
- Select an Action from the right list.
- Click Next.
- Choose whether the button displays Text or a Picture (icon).
- Type the label text (e.g., “Save Record”, “Open Report”).
- Click Next, give the button a name (used for VBA references), then click Finish.
Access creates the button and writes the macro or event code in the background automatically.
Position and Resize the Button
After the wizard closes, your button appears on the form. Fine-tune its placement:
- Move it: Click and drag the button to the exact position.
- Resize it: Click the button, then drag the orange handles on the edges.
- Align it: Select multiple controls, then use Arrange > Align to line them up.
For professional-looking forms, use the Property Sheet (F4) to set exact pixel-level dimensions under the Format tab.
Save and Test Your Form
- Press Ctrl + S to save the form.
- Switch to Form View by clicking View > Form View in the ribbon.
- Click your new button and confirm the action fires correctly.
If the button doesn’t work as expected, go back to Design View, right-click the button, and select Build Event to review or edit the assigned macro or VBA.
How to Add a Button Without the Wizard (Manual VBA Method)
If you prefer full control — or if you’re building something the wizard doesn’t cover — you can add a button and write the event code yourself.
- Turn off the Control Wizard (click the wand icon so it’s deselected).
- Draw the button on the form canvas as before.
- In the Property Sheet (F4), go to the Event tab.
- Click the On Click row, then click the … (ellipsis) button.
- Choose Code Builder and click OK.
- The VBA Editor opens with a stub:
Private Sub CommandButton0_Click()
End Sub
- Write your code between the Sub lines. Example to close the form:
Private Sub CommandButton0_Click()
DoCmd.Close
End Sub
- Press Ctrl + S in the VBA Editor, close it, and test your form.
Common Button Actions and Their VBA Code
Here are the most frequently used button actions with ready-to-use VBA:
Save the current record:
DoCmd.RunCommand acCmdSaveRecord
Delete the current record:
If MsgBox(“Delete this record?”, vbYesNo) = vbYes Then
DoCmd.RunCommand acCmdDeleteRecord
End If
Open another form:
DoCmd.OpenForm “FormName”
Navigate to a new blank record:
DoCmd.GoToRecord , , acNewRec
Open a report in Preview mode:
DoCmd.OpenReport “ReportName”, acViewPreview
Close the current form:
DoCmd.Close acForm, Me.Name
How to Add Multiple Buttons and Group Them
For forms with several functions — like a data entry form with Save, Delete, and Close — grouping buttons visually makes the interface cleaner.
- Add all buttons using the steps above.
- Hold Shift and click each button to multi-select them.
- Go to Arrange > Size & Order > Align to line them up (Left, Right, Top, or Bottom).
- Use Arrange > Size & Order > Equal Spacing to distribute them evenly.
Group buttons by function — put navigation buttons at the top and action buttons (Save, Delete) at the bottom. This reduces user errors and makes the form intuitive to anyone who opens it.
How to Customise Button Appearance
Default Access buttons look plain. Clean them up in the Property Sheet (F4 > Format tab):
- Caption: The visible label text on the button
- Font Name / Font Size: Change to match your form style
- Fore Color: Text colour (use hex codes for precision)
- Back Color: Button background colour
- Border Style / Border Color: Add or remove a border
- Width / Height: Exact size in inches
- Picture: Add an icon image to the button instead of text
For a polished look, set consistent Width and Height across all buttons on the form — this takes 2 minutes and immediately makes your database look more professional.
Troubleshooting: Button Not Working?
Button click does nothing: The wizard may not have completed. Right-click the button > Build Event > check that an On Click event exists.
“The macro or function set to the On Click property… produced an error”: This usually means a form or report name in the macro doesn’t match exactly. Names are case-sensitive in Access macros.
Button appears in Design View but is missing in Form View: Check the Visible property in the Property Sheet — it may be set to No.
Button opens the wrong record: If you’re opening a form filtered to a specific record, check the Where Condition argument in the DoCmd.OpenForm call. An incorrect filter returns the wrong result or nothing at all.
VBA code not saving: Always save with Ctrl + S inside the VBA Editor before closing it. Closing the editor without saving discards all changes.
Tips for Building Better Access Form Buttons
- Name your buttons clearly. Use names like btnSaveRecord instead of Command12. This makes debugging VBA far easier.
- Add keyboard shortcuts. In the Caption property, put an ampersand before a letter — e.g., &Save — to make Alt+S trigger the button.
- Use tab order correctly. Go to Design > Tab Order to control which button is selected first when users press Tab. Put the most-used action first.
- Confirm before destructive actions. Always add a MsgBox confirmation before Delete or Close actions to prevent accidental data loss.
- Test in Form View immediately. Every time you add a button, switch to Form View and test it before moving on. Catching issues early is faster than debugging a form with 10 buttons later.
📋 Turn Your Database Into a Pipeline
Stop building forms manually — build outbound systems that fill your calendar with qualified meetings
7-day Free Trial |No Credit Card Needed.
FAQs
Can adding form buttons in MS Access support outbound lead generation?
Can I add a button to a subform?
How many buttons can I add to one form?
Can a button run a query in Access?
We deliver 100–400+ qualified appointments in a year through tailored omnichannel strategies
- blog
- Sales Development
- How to Add a Button in MS Access Form
