Adding Command Buttons

Team-Fly    

 
10 Minute Guide to Microsoft Access 2002
By Joe Habraken
Table of Contents
Lesson 14.  Adding Special Controls to Forms

Adding Command Buttons

Another special control type that you can add to your form is a command button. Command buttons are used to perform a particular action. For example, you could put a command button on a form that enables you to move to the next record or to print the form. Access offers different command button types that you can place on your forms:

  • Record Navigation?/b> You can add command buttons that allow you to move to the next, previous, first, or last record.

  • Record Operations?/b> You can make buttons that delete, duplicate, print, save, or undo a record.

  • Form Operations?/b> Command buttons can print a form, open a page (on a multiple page form), or close the form.

  • Application?/b> Command buttons can exit Access or run some other application.

  • Miscellaneous?/b> Command buttons can print a table, run a macro, run a query, or use the AutoDialer to dial a phone number specified on a form.

Tip

Placing Command Button Form headers or footers make a great place to put any command buttons that you create. Placing them in the header makes it easy for you to go to the top of the form and click a particular command button.


To place a command button on a form, follow these steps:

  1. Be sure that the Control Wizards button in the Toolbox is selected.

  2. Click the Command Button in the Toolbox. Your mouse pointer changes to show the Command Button icon.

  3. Click your form where you want the command button to appear (such as the header of the form). The Command Button Wizard opens.

  4. On the first wizard screen, select an action category in the Categories list, and then in the Actions box (see Figure 14.8), select the action that the button should perform. Then click Next .

    Figure 14.8. Choose what action you want the command button to execute.

  5. On the next screen, you can select to have either text or a picture appear on the command button. For text, choose Text and then enter the text into the appropriate box. To place a picture on the button, select Picture and then select a picture from the list provided (you can use your own bitmap pictures on the buttons if they are available; use the Browse button to locate them). Then click Next.

  6. On the next screen, type a name for your new button. Then click Finish. The button appears on your form. You can move it around like any other control.

In this lesson, you learned how to create list and combo boxes, option groups, and command buttons. In the next lesson, you learn how to search for data in a table and replace it with the Find and Replace features.


Team-Fly    
Top
 


10 Minute Guide to Microsoft Access 2002
10 Minute Guide to Microsoft Access 2002
ISBN: 0789726319
EAN: 2147483647
Year: 2000
Pages: 160
Authors: Joe Habraken

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net