Working with action buttons

When you create or use a Microsoft Access app, you use the action buttons to perform various tasks such as add, modify or delete the records. Actions are somewhat like the controls on a form. Some actions are predefined which cannot be changed or deleted but you can add custom actions to suit your app needs. Each view in an Access app displays specific predefined actions that can be performed from that view. This article gives you an overview of the predefined actions and explains how you can add custom actions to a view. If the Action Bar on which the actions are displayed is hidden by the app developer, the actions are not visible and if the record source is set as read only, the actions will not be available as you will only be able to view the data.

For information, see creating an Access app.

What do you want to do?


Overview

The type of action displayed on the Action Bar depends on the view that you are in. The predefined actions automatically perform specific tasks. If you hover over an action button, its functionality is displayed. The following image is a sample of actions on an Action Bar, and their respective functionality:

Actions: buttons on the action bar in access apps
Functionality: Add Delete Edit Save Cancel Filter

Actions such as add, delete and save are predefined by Access and these can be performed in the in which they appear. Predefined actions can neither be removed from the view nor be modified. You can add custom actions to most views and we’ll see how later in this article. In the next section, let’s take a look at how you can use the predefined actions.

Top of Page Top of Page

Predefined actions

Access apps provide four predefined actions that are displayed on the Action Bar based on the view you select. While you cannot edit or delete predefined actions, you can change the order in which they appear on the Action Bar or hide the entire Action Bar in a view.

 Note    Hiding the Action Bar is not recommended unless you have provided an alternate navigation option for your app.

The following table includes the predefined actions, their functionality and keyboard shortcuts:

Button Action Keyboard shortcut
add record button on the action bar Add new record N
delete record button on the action bar Delete record Delete
edit action control Edit record E
Save action Save record Ctrl + S

 Note    When you create a new app in Blank view, predefined actions are not displayed.

Using predefined actions

Add a record

The Add action is available in List and Datasheet views if the table is updateable. Use the Add action to add a new record to a table. To use the action, complete the following steps from an opened Access app:

Add records to a table
  1. Click the List view. (You can also add records from the Datasheet view.)
  2. Click the property button and click Open in Browser.
Add a record to a table
  1. Click Add add record button on the action bar and the fields are displayed.

 Note    Only the Cancel action is available at this point. As soon as you start adding data, the Save and Add actions also become available.

  1. Add the information for the new record and click Save Save action .

Repeat step 3 to add more records.

Top of Page Top of Page

Delete a record

The Delete action is available in the List and Datasheet views when the table property is set as updateable.

  1. To delete a record, open the table in either Datasheet or List view.
  2. Select the record, and then click the Delete delete record button on the action bar action.
  3. When Access asks you to confirm the delete action, select one of the following options:
  • To cancel the delete action, click Cancel.
  • To continue with the delete action, click Delete.

When you delete a record, the record no longer appears in the view and you’ll see the following changes:

  • The record immediately after the deleted record is highlighted.
  • The previous record is highlighted, if you deleted the last record in a table,
  • The remaining record in a table is displayed, if it is the only remaining record, the view switches to display the no-records view.

Top of Page Top of Page

Edit a record

The Edit action edit action control is available only in the List view when the table’s data property is set as updateable. When you open the List view, the Edit, Add and Delete actions are available.

  1. To edit an existing record, open the table in List view and click the Edit action.
  2. Make the required changes and then click the Save action.

 Note    As you start modifying data in a field, the Cancel and Save actions become available.

Top of Page Top of Page

Save a record

The Save action becomes available after you modify information for a record in the List view. When you click the Save action in an Access app, the modified data is sent to the server. If there is a save conflict, Access displays an error message.

 Note    The Save action is not available when the record is in read mode or when the table property is set as not updatable.

Top of Page Top of Page

Cancel changes to a record

You can cancel any data modification from the List view if, a record has unsaved changes and the property is set as updatable.

To cancel any changes to a record soon after you made it:

  • Click the Cancel action. The recently edited fields display the values stored in the database.

 Note   The Save and Cancel actions become unavailable after you perform a cancel action and the fields change to the read only mode.

Top of Page Top of Page

Views and actions

Access displays specific actions with views based on tasks that you can perform from that view. This following table lists the availability of action buttons for various views.

List   : This view displays the most number of actions.

Condition Actions available
When adding the first record Save and Cancel
When adding records when other records already exist Cancel
When adding a record after modifying a previous record Save and Cancel
When reading updatable data Add, Delete and Edit
When reading non-updatable data None
When editing a record Save and Cancel

Datasheet view   : Only Add and Delete actions are available from Datasheet view.

Summary view   : None of the actions are available from the Summary view.

Blank view   : Actions only appear when the record source property is set. The actions that appear are inherited from the List view.

Top of Page Top of Page

Create and use custom actions

If you have permissions to change the design of an Access app, you can add new actions to the Action Bar and customize it to run on click by using macros. You can also change existing macro actions from the Access app designer.

There is a limit to how many actions you can add to a view, and when you reach the maximum limit, Access displays a message indicating that the limit has been reached. If you see this message, you can delete existing custom actions and add more actions. .

Unlike predefined actions, custom actions can be created, modified or deleted. You also can select the icon for a custom action and its position on the Action Bar.

  • To change the order in which an action is displayed, click on the action button and drag it to a new position on the Action Bar. The tab order automatically changes to reflect the new order.

Add a custom action

  1. Open the Access app, from the Navigation Pane right-click the form where you want to add the action, and then click Open.

 Tip    If the Navigation Pane is not visible, from the Home tab, click Navigation Pane.

  1. Click Add custom action button.

Adding a new custom action to the Action Bar.

  1. Click to select the custom action and then click the Data property button.

add custom controls in an access app

  1. To customize the action, make changes to the following properties:
  • Name: Type a name for the action.
  • Tooltip: You can add a brief description of the action. Adding a tooltip is optional but it can be helpful to others if they are able to see a description of what action is performed upon clicking the button.
  • Icon: Click the arrow next to the default icon and pick an icon from the gallery. Make sure that you pick one that is not already on the Action Bar or you will have duplicate icons displayed.
  1. Click On Click and add a macro action for the button.
  2. Right-click the macro tab, save and then close it.

Edit a custom action

  1. Click to select the action.
  2. Click the Data property button, and then make your changes.

Delete a custom action

  • Select the action and press Delete on your keyboard.

You can also select and delete multiple custom actions at the same time. When you delete an action, the icon is removed from the Action Bar but not from the icon gallery.

Undo a deleted custom action

  • Click the undo button Button Image on the Quick Access Toolbar.

Move an action button on the Action Bar

  • Click and hold the button and drag it to a new position on the Action Bar.

Top of Page Top of Page

 
 
Applies to:
Access 2013