Microsoft Access can be used for creating a command button and adding actions to it. This can easily be done by using the command button wizard given in Microsoft Access. Command button is a control that runs a macro, calls a Visual Basic function or runs an event procedure.

Let us see the basic steps involved in creating a Command Button in MS access form or report:

Step1: Open a form or a data access page in the Design view ( A view that shows the design of these database objects: tables, , forms, queries, reports, and macros. In Design view, you can create the new database objects and modify the design of existing objects.).

Step 2: Make sure that the Control Wizards Button image tool in the toolbox is pressed in.

Step 3: In the toolbox, click Command Button Control tool.

Step 4: On the form or data access page inside MS Access, click where you want to add the command button.

Step 5: Follow the directions in wizard dialog boxes. In last dialog box, click on Finish to display the command button in Design view.

Now lat us see the basic steps involved in modifying a command button without a wizard.

Step 1: Open a form or a data access page in the Design view ( A view that shows the design of these database objects: tables, forms, queries, reports, and macros. In Design view, you can create the new database objects and modify the design of existing objects.).

Step 2: Make sure that the Control Wizards Button image tool in the toolbox is not pressed in. This will turns off the wizard.

Step 3: In the toolbox, click on the Command Button tool Control.

Step 4: On the form or data access page in MS Access, click where you want to add the command button.

Step 5: Make sure that command button is selected, and then click on Properties Button image on the toolbar to open command button’s property sheet (A pane that is used to view or modify the properties of various objects such as tables, fields, queries, forms, data access pages, reports, and controls.).

Step 6: In the property box of the form, enter the name of macro or event procedure that you want to run when button is clicked or click on the Build button to use Macro Builder or Code Builder. On a data access page, you can attach the code written in either JScript (A scripting language that can be used to add functionality to a Web site or a Web page or, or to enhance the look of one) or Microsoft Visual Basic Scripting Edition to a command button by using Microsoft Script Editor.

Step 7: Now do one of the following:

  • To display the text on a command button on a data access page: Type text in command button’s Value property box.
  • To display the text on a command button on a form: Type text in command button’s Caption property box.
  • To display the picture on a command button on a form: In command button’s Picture property box, type the path and the file name for a .bmp, .dib, or .ico file.

This is the whole procedure for creating and modifying a command button in MS Access.