Creating a Form by Using an AutoForm


Although a form doesn’t have to include all the fields from the underlying table, when it is intended as the primary method of creating new records, it usually does. The quickest way to create a form that includes all the fields from one table is to use the Form button, as you did in the first exercise in this chapter. Another method, which provides more control over the creation of the form, is to use a wizard. In either case you can easily customize the forms created.

In this exercise, you will use a wizard to create a form that displays information about each of the product categories.

Use the 06_CreateWizard database. This practice file is located in the Chapter10 subfolder under SBS_Office2007.

Open the 06_CreateWizard database. Then open the Categories table in Datasheet view.

1. On the Create tab, in the Forms group, click the More Forms button and then in the list, click Form Wizard. image from book

The Form wizard starts.

image from book

2. With the Categories table selected in the Tables/Queries list, click the Move All button to move all the table fields to the Selected Fields list, and then click Next.image from book

On the second page of the wizard, you choose the layout of the fields in the new form. When you select an option on the right side of the page, the preview area on the left side shows what the form layout will look like with that option applied.

3. With the Columnar option selected, click Next.

On the third page of the wizard, you can select a style option to see how the style will look when applied to the form.

4. In the list of styles, click Office, and then click Next.

Because this form is based on the Categories table, Access suggests Categories as the form’s title.

5. With the Open the form to view or enter information option selected, click Finish.

The new Categories form opens, displaying the first category record in the Categories table.

image from book

6. Scroll through a few records by using the navigation controls at the bottom of the form.

Tip 

To change the style of a form after you create it, switch to Design view, and on the Arrange tab, in the AutoFormat group, click AutoFormat. In the list displayed, click the style you would like to use.

7. Switch to Design view so that you can make a few more changes.

8. Delete the word Category from the Category Name label.

9. You don’t want to expose the CategoryID field to form users, because that value should never be changed. Click the CategoryID text box, and if the control’s Property Sheet pane isn’t open, press image from book to display it.

10. In the Property Sheet pane, on the Data tab, change Enabled to No. Then press image from book to close the Property Sheet pane. Disabling the CategoryID text box changes it, and the label text, to gray.

11. Switch to Form view, and then scroll through a few categories. Try to edit entries in the CategoryID field to confirm that you can’t.

12. You don’t need scroll bars or a record selector in this form, so return to Design view, and then display the form’s Property Sheet pane by clicking the Form selector (the box in the upper-left corner) and pressing. image from book

13. In the Property Sheet pane, on the Format tab, change Scroll Bars to Neither and Record Selectors to No. Then close the Property Sheet pane.

14. Switch to Form view to see the effect of your changes.

Close the Categories form, saving your changes, and then close the 06_CreateWizard database.



2007 Microsoft Office System Step by Step
2007 MicrosoftВ® Office System Step by Step
ISBN: 0735622787
EAN: 2147483647
Year: 2004
Pages: 231

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