Creating Forms

Forms are vital for allowing users to add, modify, and delete data within your database applications. Access 2007 provides an extensive forms package and several designers to afford you robust functionality for your forms. While it is quite easy to create forms via Access automation, often times, it is much more practical to build forms using the Access Form designers.

The Access Ribbon's Create tab has several options for forms (see Figure 1-9) to enable you to reduce development time by quickly creating common form types.

The Create Ribbon hosts nine different options for creating various predefined form types: Form, Split Form, Multiple Items Form, Datasheet Form, Pivot Chart Form, Pivot Table Form, Modal Form, Blank Form, and Form Design. An important fact to remember is that the Form, Split Form, Multiple Item Form, Datasheet Form, Pivot Table Form, and Pivot Chart Form options will be created based upon the object that is selected in the Navigation pane. If the Navigation pane does not currently have focus, the form will be based on the open object that does have focus. For example, selecting a query in the Navigation pane and then clicking the Form button creates a new form for that query. This rule applies for Tables Queries, Forms, and Reports that are selected in the Navigation pane. If you select any object that does not support creating one of the quick forms, such as a Macro, some of the buttons in the Ribbon become disabled. Any of the quick forms can be created in Design view mode by using the Form Design option. When all else fails, use the Design view to manipulate the form to just the right settings because all design changes can be made in Form Design mode. If you've used Access previously, you know that this used to be the only view mode available for designing forms and reports.

Click on the Assets table to select it in the Navigation pane and then click the Form button. This creates a new form in Layout View mode already populated with controls working with the fields in the Assets table. New to Access 2007, Layout View is a view mode for forms and reports that enables you to view data while building the new form. Figure 1-10 shows an example for the new form.

Depending on which view mode you have open for forms and reports, you only have a certain set of tools available. Controls and several other features can be added only in Design view mode. However, Layout mode is still quite useful because of the capability to see exactly what the object will look like with real data, while you are creating it. It's also nice to see formatting changes such as image and color changes while in Layout view mode, along with seeing the actual finished form without the design grid.

Click on the Close button in the top-right corner of the form. Once again, a save dialog box displays. Type in the name Assets Form and click OK. The new form is added immediately to Navigation pane.

0 0

Post a comment