Presentation is loading. Please wait.

Presentation is loading. Please wait.

Forms. Forms provide a more convenient user interface for such things as adding new records or editing or deleting existing records in a table. They can.

Similar presentations


Presentation on theme: "Forms. Forms provide a more convenient user interface for such things as adding new records or editing or deleting existing records in a table. They can."— Presentation transcript:

1 Forms

2 Forms provide a more convenient user interface for such things as adding new records or editing or deleting existing records in a table. They can also be created to customize the entire user interface to the database itself.

3 The following is an example of a form to be used to display records from a single table. This form can also be used to edit, add to, or delete records from this table. Here it is being displayed in Form View.

4

5 Various parts of this form represent Bound controls Unbound controls Calculated controls Also on this form are 4 buttons, at the bottom.

6 The text “Birthdate” is an example of an unbound control, while the place where the corresponding value “10/20/75” is displayed is a bound control. Unbound controls are taken from field names or other text the user designs into the form. Bound controls come from data in the database.

7 The text “Age” is another unbound control, but the value “25” displayed next to it is an example of a calculated control. The number 25 is not in the underlying table, but is calculated from the Birthdate field using the expression =(Date()-[Birthdate])/365.

8 To create a form like this, first use the Form Wizard. Then switch to Form Design View to make any desired modifications, including altering the layout of the form and adding other controls to it.

9 When in Form Design View, a toolbox toolbar is displayed. Among the buttons on this toolbar are one for adding text labels (e.g., “Age”), another for adding text boxes for calculated controls (where the appropriate expression can be entered), and yet another to add buttons to the form.

10 To specify such things as the formatting of data displayed on the form, use the Design View and right click on the control whose formatting you want to change and select Properties. Here you will see many details of the controls that you can potentially alter if desired.

11 Another available view of a form is the Datasheet View. This looks almost identical to the Datasheet View of the underlying table, except that what is displayed in each row is exactly the values displayed on the form, including any calculated controls.

12 Switchboard Another type of form used as a top-level user interface to a database is a switchboard. To create a switchboard, do Tools => Database Utilities… and choose Switchboard Manager. The switchboard created this way is actually a form based on a Switchboard Items table.

13 Furthermore, if you go to the Tools => Startup… dialog box and select your Switchboard as the form to open when Access starts running on your database, users can interact with it using only your customized interface. Here is an example:

14

15 Forms with subforms Sometimes it is useful to create a form based on data stored in multiple tables. In this case there may be a main form to display records from one table, along with a subform to display records from a related table. Here we consider the following example:

16

17 In this case there is a many-to-one relationship between loans and customers (meaning that one customer may have more than one loan, but each loan is for just one customer).

18 In this case it might be reasonable to want a form to display customer data drawn not only from the Customers table, but also the corresponding data from the Loans table on all loans for a particular customer.

19 The resulting form will consist of a main form based on the Customers table and a subform based on the Loans table. We can create this form easily using the Form Wizard. Here is how it looks:

20

21 As is typical when displaying a main form together with a subform, the main form is diplayed in Form View and the subform is displayed in Datasheet View. However, the view used for each can be changed independently, as desired.


Download ppt "Forms. Forms provide a more convenient user interface for such things as adding new records or editing or deleting existing records in a table. They can."

Similar presentations


Ads by Google