How to use buttons in microsoft access




















Delete a custom action. Undo a deleted custom action. Move an action button on the Action Bar. The type of action buttons displayed on the Action Bar depend on the view that you are using. 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 such as Add, Delete and Save are predefined by Access and these can be performed in the context in which they appear. If you remove a predefined action from a view, you can't add it back. Predefined actions can't be modified from any of the view types. Access displays specific predefined action buttons in the Action Bar with views based on tasks that you can perform from that view. This following table lists the availability of the predefined action buttons for various views and when they are enabled.

List : This view displays the most number of actions. Datasheet view : Add, Delete, and Download in Excel action buttons are available from the Datasheet view. Add and Delete are enabled at all times except when entering data on a new record.

The Download in Excel action button is enabled at all times in Datasheet views. Summary view : None of the action buttons are available from the Summary view. Blank view : Action buttons only appear in the Action Bar for Blank views when the record source property is set. The action buttons that appear In Blank views are inherited from the List view.

Note: Predefined action buttons are not enabled for a view if the view is opened as a popup through a Summary view. When opening a view as a popup from a Summary view, Access sets the data as non-updatable. Access apps provide six predefined action buttons that are displayed on the Action Bar based on the view type you select.

The number of predefined actions shown depends on the view type. While you cannot edit predefined action buttons, 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 provide alternate navigation options for your app. The following table includes the predefined action buttons, their functionality and keyboard shortcuts:.

Note: When you create a new Blank view in an Access app, predefined action buttons are not displayed until you define a record source for the view. The Add new record action button is available in List and Datasheet views if the view has a record source that is updateable. The Add new record action button is also available in Blank views if the view has a defined record source and is updateable. Use the Add action button to add a new record to a table.

To use the action, complete the following steps from an opened Access app:. After the list view opens in your web browser, click Add and the fields are displayed. Note: Only the Save and Cancel actions are available at this point.

Add the information for the new record and click Save. The Delete record action button is available in the List, Blank and Datasheet views if the view has a record source that is updateable.

Select the record, and then click the Delete action. The remaining record in a table is displayed, if it is the only remaining record, the view switches to display the no-records view. The Edit record action button is available only in List and Blank views when the view has a record source that is updateable.

To edit an existing record, open the table in List view in your web browser and click the Edit record action button. As you start modifying data in a field, the Cancel and Save actions become available.

The Save record action button becomes available after you modify information for a record in a List or Blank view. When you click the Save record action button 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 record action button is not available when the record is in read mode or when the view has a record source that is not updatable.

Note: Datasheet views do not include a Save record action button because Access automatically attempts to save any record changes when you move to a different record. You can cancel any data modification from List and Blank views if, a record has unsaved changes and if the view has a record source that is updatable. Step 4: Users might notice that their cursor has turned into a plus sign that also has a button like a picture attached to it.

Users need to use their cursor to draw or create a structure of button on their form. Step 5: Once the user has created the new button in the form, a Command Button Wizard will automatically appear on the screen. Typically a Command Button can invoke a preset function on a form. It can also launch on a Macro or through a custom VBA code. Step 6: This next step gives the user two options, either to use a picture or an icon on the Command Button or to use a text title on the button. Step 7: Now the users need to give a name to their button, using the Command Button Wizard.

Step 8: Once you have made all the necessary changes save the form. Also, ensure to view the form after saving it. We also recommend you to run the Command Button, to ensure that it is working properly in the Form. This process converts to VBA any macros that are referred to by or embedded in a form or report or any of its controls and adds the VBA code to the form or report's class module.

The class module becomes part of the form or report and moves with the form or report if it is moved or copied. In the Navigation Pane, right-click the form or report, and then click Design view. In the Convert form macros or Convert report macros dialog box, select whether you want Access to add error handling code to the functions it generates. Also, if you have any comments in your macros, select whether you want to have them included as comments in the functions. Click Convert to continue.

If no class module exists for the form or report, Access creates one and adds a procedure to the module for each macro that was associated with the form or report. Access also changes the event properties of the form or report so that they run the new VBA procedures instead of the macros. While the form or report is still open in Design view, if the property sheet is not already displayed, press F4 to display it.

On the Event tab of the property sheet, click in any property box that displays [Event Procedure] , and then click the build button. To view the event properties for a specific control, click the control to select it.

To view the event properties for the entire form or report, select Form or Report from the drop-down list at the top of the property sheet. Access opens the Visual Basic Editor and displays the event procedure in its class module. You can scroll up or down to view any other procedures that are in the same class module. In the Navigation Pane, right-click the macro that you want to convert, and then click Design View.

In the Convert Macro dialog box, select the options that you want, and then click Convert. Under Modules , double-click the module Converted Macro- macro name.

Unlike a class module, a standard module is not part of a form or report. You will most likely want to associate the function with an event property on a form, report, or control so that the code runs exactly when and where you want. To do this, either you can copy the VBA code into a class module and then associate it with an event property, or you can make a special call from the event property to the standard module by using the following procedure.

In the Visual Basic Editor, make a note of the function name. For example, if you converted a macro named MyMacro, the function name will be MyMacro. In the Navigation Pane, right-click the form or report with which you want to associate the function, and then click Design View. On the Event tab of the property sheet, click the event property box with which you want to associate the function.

Be sure to include the parentheses. In the Navigation Pane, double-click the form or report, and test it to see that the code runs as it should. You now know the basic steps to add VBA code to your database. This article describes only the basics of how to get started; there are many excellent reference books and online resources that can help you build your programming skills.

Need more help? Expand your skills. Get new features first. Was this information helpful? Yes No. Thank you! Any more feedback? The more you tell us the more we can help. Can you help us improve? Resolved my issue. Clear instructions. Easy to follow. No jargon. Pictures helped. Didn't match my screen. Incorrect instructions.

Too technical. Not enough information. Not enough pictures. Any additional feedback? Submit feedback.



0コメント

  • 1000 / 1000