custom forms

67
Creating your own form from scratch.

Upload: rod

Post on 14-Jan-2016

41 views

Category:

Documents


0 download

DESCRIPTION

Custom Forms. Creating your own form from scratch. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Custom Forms

Creating your own form from scratch.

Page 2: Custom Forms

To create a custom form, you can modify an existing form or design and create a form from scratch. In either case, you create a custom form working in the Form window in Design view. A custom form can be designed to match a paper form, to display some fields side by side and others top to bottom, to highlight certain sections with color, or to add special buttons and list boxes.

Page 3: Custom Forms

A multi-page form displays the form on more than one page on a single screen. Each page is labeled with a tab like the tabs in the Database window. By clicking a tab, you can display the information on that page.

Page 4: Custom Forms

Whether the custom form you want to create is a simple or complex from, it is always best to plan the form’s content and appearance first.

The figure to the right shows a design for the custom form that we will be working with today.

Page 5: Custom Forms

Page 1 of the form

Notice that the top of the design on page

one indicates that a title

and a graphic image

are to be displayed.

Page 6: Custom Forms

Page 1 of the form

Below the title and graphic image we see

that the CustomerNum

and the CustomerName

fields are indicated.

Note also that the first page (shown above, labeled “Customer Information” displays the address information for the customer.

Page 7: Custom Forms

The second page, labeled “Orders,”displays order information for the customer. Eachfield value from the Customer table will appear in a text box and will be preceded by a label. The label will be the value of the field’s caption property (if any) or the field name.

Page 2 of the form

Page 8: Custom Forms

The locations andlengths of each fieldvalue are indicatedby a series of Xs inthe form design.

For example, the three Xs that follow the CustomerNum field label indicate that the field value will be three characters long. The Order table fields appear in a subform on the second page.

Page 2 of the form

Page 9: Custom Forms

With the design for the custom form in place, you are ready to create it. You could use an Autoform Wizard to create a basic form and then customize it in Design view. However, you would need to make many modifications to a basic form to create the form shown in our paper design, so you will design the entire form directly in Design view.

Page 10: Custom Forms

You use the Form window in Design view to create and modify forms. To create our custom form you’ll create a blank form based on the Customer table and then add the Order table fields in a subform later.

Page 11: Custom Forms

The Form window in Design view contains the tools necessary to create a custom form. You create the form by placing objects on the blank form in the window. Each object - such as a text box, list box, rectangle, or command button - that you place on the form is called a control.

Page 12: Custom Forms

There are three kinks of controls that you can place on a form.

A bound control is linked, or bound, to a field in the underlying table or query. You use a bound control to display the table field values.

Page 13: Custom Forms

An unbound control is not linked to a field in the underlying table or query. You use an unbound control to display text, such as a form title or instructions, or to display graphics and pictures from other software programs. An unbound control that displays text is called a label.

Page 14: Custom Forms

A calculated control displays a value calculated from data from one or more fields by using an “expression” (formula) as we saw in queries.

Control source: =[InvoiceAmt] * .02

Page 15: Custom Forms

To create a bound control, you use the Field List button on the Form Design toolbar to display a list of fields available from the underlying table or query. Then you drag fields from the field list box to the Form window and place the bound controls where you want them to appear on the form

Page 16: Custom Forms

View Field List Tool on the Toolbar

Page 17: Custom Forms

Let’s take a look at the Form window design view for a moment and see some of the elements that we will be working with.

Page 18: Custom Forms

Rulers

The Detail Section of the form

Field List

Tool Box

Page 19: Custom Forms

The Detail Section of the form appears as a light gray rectangle, in which you place the fields, labels, and values for your form. You can change the size of the Detail section by dragging its edges.

Page 20: Custom Forms

The Form Selector Button is located in the upper left corner of the design window, where the rulers intersect. You use this to select the form to view it’s properties.

Page 21: Custom Forms

DemonstrationDemonstrationDemonstrationDemonstration

Viewing the Form’s Properties

Page 22: Custom Forms

The grid consists of the dots that appear in the Detail section to help you position controls precisely on a form. If the dots on the grid appear to close together you can increase the size by changing the grid X and grid Y properties in the form’s properties window.

Page 23: Custom Forms

DemonstrationDemonstrationDemonstrationDemonstration

Changing the Grid of a Form Design Window.

Page 24: Custom Forms

Rulers

The rulers at the top and at the left edge of the Detail section define the horizontal and vertical dimensions of the form and serve as a guide to the placement of controls on the form.

Page 25: Custom Forms

There are two ways to view a Form design Window

First, create a new form from scratch.

Second, view the design view from an already existing form

Page 26: Custom Forms

Creating a new form from scratch

Click on the Forms Button on the Left and then Click on the New Button on the top.

Click on the Forms Button on the Left and then Click on the New Button on the top.

Page 27: Custom Forms

The New Form Dialog box will appear. From this window select the Design View, select the tableor query thatyou wish theform to b bound to(if any) andthen click OK.

Page 28: Custom Forms

The New Form will then appear in the design view ready for you to add objects to it.

Page 29: Custom Forms

Adding Fields to a Form

There are two ways to add fields to a form

Page 30: Custom Forms

Adding Fields to a Form

First by using the “View Field List” button.

Page 31: Custom Forms

Using the field List

When you click the Field List Button a list of fields from the underlying table or query will appear.

Page 32: Custom Forms

Using the field List

When the field list is visible, you can either click on it’s title bar to select all fields

Page 33: Custom Forms

Using the field List

When this is done all fields in the list will be selected. You can click on any one of them and drag them to the form.

Page 34: Custom Forms

Using the field List

Or you can click on one field at a time, holding the mouse down and dragging that field to the form.

Page 35: Custom Forms

Adding Fields to a Form

The second way to add a field is by using the ToolBox

Page 36: Custom Forms

To place a field or other controls on a form, you use the tools on the toolbox. The toolbox is a specialized toolbar containing buttons that represent the tools you use to place controls on a form or a report. Screen Tips are available for each tool. If you want to show or hide the toolbox, click the Toolbox button on the form Design toolbar.

Page 37: Custom Forms

Summary of Tools Available in the toolbox for a form or report

Button Tool Name

Select Objects

Control Wizards

Label

Text Box

Purpose

Select, move, size and edit controls

Activate Control Wizards for certain other toolbox tools

Display text, such as title or

instructions; an unbound control

Display a label attached to a text box that contains

a bound control or a bound or

calculated control

Wizard Available?

No

No

No

No

Page 38: Custom Forms

Summary of Tools Available

Button Tool Name

Option Group

Toggle Button

Option Button

Check Box

Purpose

Display a group frame containing

toggle buttons

Display a toggle button control

bound to a Yes/No field

Display an option button control

bound to a Yes/No field

Display a check box control bound to a Yes/No field

Wizard Available?

Yes

Yes

Yes

Yes

Page 39: Custom Forms

Summary of Tools Available

Button Tool Name

Combo Box (Similar to the Lookup Field)

List Box

Command Button

Image

Purpose

Display a control that combines the features of a list

box and a text box.

Display a control that contains a

scrollable list of values

Display a control button you can use to link to a

macro

Display a graphic Image

Wizard Available?

Yes

Yes

Yes

Yes

Page 40: Custom Forms

Summary of Tools Available

Button Tool Name

Unbound Object Frame

Bound Object Frame

Page Break

Tab Control

Purpose

Display a frame for enclosing an unbound OLE

object, such as an Excel Worksheet

Display a frame for enclosing a bound OLE object stored

in an Access database table

Begin a new screen on a form

or a new page on a report

Display a tab control with

multiple pages

Wizard Available?

Yes

Yes

No

No

Page 41: Custom Forms

Summary of Tools Available

Button Tool Name

Sub form or sub report

Line

Rectangle

More Controls

Purpose

Display data from multiple tables

Display a line

Display a rectangle

Display a list of all available controls

Wizard Available?

Yes

No

No

No

Page 42: Custom Forms

Before you can modify a control on a form you first must select that control. To select a control simply click on it. When the control is selected, handles will appear around it’s edges.

Page 43: Custom Forms

You can move a field-value text box and its attached label box together. To move them, place the pointer anywhere on the border of the field-value text box, but not on the move handle or a sizing handle. When the pointer changes to a hand symbol, you can drag the field and its attached label to a new location.

Page 44: Custom Forms

You can also move either the field-value text box or its label box individually. If you want to move the field-value text box but not its label box, for example, place the pointer on the text box’s move handle. When the pointer changes to a hand symbol witha pointing finger,drag the field-value text box to anew location.

Page 45: Custom Forms

You can also resize objects. Not just fields and labels, but any object on the form using a similar technique but this time using the resizing pointers

Page 46: Custom Forms

Adding Headers and Footers

The Form Header and Form Footer sections allow you to add titles, instructions, command buttons, and other information to the top and or botton of your form.

Page 47: Custom Forms

To add a Page Header/footer or Form Header/Footer, Select View from the menu bar and then select the Page Header/Footer or Form Header/Footer Option.

Page 48: Custom Forms

Adding Labels

When you add a text box to a field, a label will automatically be placed with it. If you delete the label and need to add one manually, or simply need to add a stand alone label, you can use the label tool on the toolbox to accomplish this.

Page 49: Custom Forms

Changing Label Captions

To change the Caption of a label, right-click the label, click Properties on the shortcut menu, click the Format tab, edit the existing label in the Caption text box or double-click it to select the current value, and then type a new caption.

Page 50: Custom Forms

Changing Label Captions

right-click the labelright-click the label

Page 51: Custom Forms

Changing Label Captions

Left-Click on Properties

Left-Click on Properties

Page 52: Custom Forms

Changing Label Captions

click the Format tab

click the Format tab

Page 53: Custom Forms

Changing Label Captions

edit the existing label in the Caption text boxedit the existing label in the Caption text box

Page 54: Custom Forms

DemonstrationDemonstrationDemonstrationDemonstration

Using the ToolBox to add a Label Object to your form

Page 55: Custom Forms

Adding Images

You can use the Image tool on the toolbox to insert a piece of clip art or photo to your form. This is used to place images created by other applications.

There are several other ways as well to accomplish this.

Page 56: Custom Forms

DemonstrationDemonstrationDemonstrationDemonstration

Adding Images to your form

Page 57: Custom Forms

Changing Background Colors of Objects

You can change the back-ground color of a form orof a specific section orobject on the form by using tools available in Design View.

Page 58: Custom Forms

DemonstrationDemonstrationDemonstrationDemonstration

Changing Background Colors

Page 59: Custom Forms

Page AC 5.40

Quick Check ReviewQuick Check Review

Page 60: Custom Forms

Quick Check ReviewQuick Check Review

Let’s take a fewmoments to break upinto discussion groups.Each group will discussthe quick check questions on pageAC 5.40 in your books. We will then review the answers at the end of the discussion.

Page 61: Custom Forms

Quick Check Review Quick Check Review Session 5.2Session 5.2

1) What is the difference between a bound control and an unbound control?

Page 62: Custom Forms

Quick Check Review Quick Check Review Session 5.2Session 5.2

2) How do you move a control and its label together?

Page 63: Custom Forms

Quick Check Review Quick Check Review Session 5.2Session 5.2

3) How do you change a label name?

Page 64: Custom Forms

Quick Check Review Quick Check Review Session 5.2Session 5.2

4) How do you resize a control?

Page 65: Custom Forms

Quick Check Review Quick Check Review Session 5.2Session 5.2

5) What is the Form Header section?

Page 66: Custom Forms

Quick Check Review Quick Check Review Session 5.2Session 5.2

6) How do you insert a picture,created using another software program, in a form?

Page 67: Custom Forms

Your task for this session is to complete the exercises in Tutorial #5 Page AC 5.25 through Page AC 5.39

The disk isLevel 2Disk 1