Forms Using. 2 Plan a form Create a form Move and resize controls Modify labels Modify text...

27
Forms Forms Using Using

Transcript of Forms Using. 2 Plan a form Create a form Move and resize controls Modify labels Modify text...

Page 1: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

FormsFormsUsingUsing

Page 2: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

2

Plan a formPlan a form Create a formCreate a form Move and resize controlsMove and resize controls Modify labelsModify labels Modify text boxesModify text boxes

ObjectivesObjectives

Page 3: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

3

Modify tab orderModify tab order Enter and edit recordsEnter and edit records Insert an imageInsert an image

ObjectivesObjectives

Page 4: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

4

Unit IntroductionUnit Introduction

A A formform is an Access database object is an Access database object that allows you to present information that allows you to present information in a format that makes entering and in a format that makes entering and editing data easy.editing data easy.– Forms are the primary object used to Forms are the primary object used to

find, enter, and edit datafind, enter, and edit data– You can design the layout of fields in a You can design the layout of fields in a

formform

Page 5: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

5

Planning a FormPlanning a Form

Forms are often built to match a Forms are often built to match a source documentsource document to facilitate fast and to facilitate fast and accurate data entry.accurate data entry.– Because users enter data directly into Because users enter data directly into

the database, a well designed form is the database, a well designed form is importantimportant

– A A controlcontrol is used to display data in a is used to display data in a formform

Page 6: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

6

Planning a Form (cont.)Planning a Form (cont.)

Form design considerations.Form design considerations.– Determine purpose of the formDetermine purpose of the form– Determine underlying record sourceDetermine underlying record source– Gather source documentsGather source documents– Determine the best type of controlDetermine the best type of control

• Bound controlsBound controls display data from the display data from the underlying record sourceunderlying record source

• Unbound controlsUnbound controls do not change from do not change from record to record and exist only to clarify record to record and exist only to clarify and enhance the form appearanceand enhance the form appearance

Page 7: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

7

Planning a Form (cont.)Planning a Form (cont.)

Form Controls

Page 8: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

8

Planning a Form (cont.)Planning a Form (cont.)

Tab control

Text box

Combo box

Label

Option group

Toggle buttonOption button

Bound object frame

Page 9: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

9

Planning a Form (cont.)Planning a Form (cont.)

Unbound object frame

List box

Command button

Rectangle

Check box

Page 10: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

10

Creating a FormCreating a Form

Create a form from scratch using the Create a form from scratch using the Form Design View or the Form Form Design View or the Form wizard.wizard.– The Form Wizard provides guided The Form Wizard provides guided

steps to create a formsteps to create a form• Select record source, choose overall Select record source, choose overall

layout, style, and titlelayout, style, and title

– Use Form Design View to modify an Use Form Design View to modify an existing form objectexisting form object

Page 11: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

11

Creating a Form (cont.)Creating a Form (cont.)

Labels

Check box

Text box

Page 12: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

12

Creating a Form (cont.)Creating a Form (cont.)

Form creation techniques

Page 13: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

13

Moving and Resizing ControlsMoving and Resizing Controls

Modify the size, location, and Modify the size, location, and appearance of existing controls in appearance of existing controls in Form Design ViewForm Design View– Add controls to the form with the Add controls to the form with the

Toolbox toolbarToolbox toolbar– The The field listfield list contains fields in the contains fields in the

record sourcerecord source

Page 14: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

14

Moving and Resizing Controls Moving and Resizing Controls (cont.)(cont.)

Label

Field list

Vertical ruler

Toolbox toolbar

Field List button

Toolbox button

Object list box

Page 15: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

15

Moving and Resizing Controls Moving and Resizing Controls (cont.)(cont.)

Sizing handles appear in the corners Sizing handles appear in the corners and on the edges of selected and on the edges of selected controls.controls.– The mouse pointer shape is important The mouse pointer shape is important

when working with controlswhen working with controls

Form Design View mouse pointers

Page 16: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

16

Moving and Resizing Controls Moving and Resizing Controls (cont.)(cont.)

When you move a bound control, the When you move a bound control, the accompanying unbound label moves accompanying unbound label moves with it.with it.– The field name for the selected control The field name for the selected control

appears in the Object list boxappears in the Object list box– Moving and resizing controls requires Moving and resizing controls requires

concentration and mouse controlconcentration and mouse control

Page 17: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

17

Modifying LabelsModifying Labels

Modify a label control by directly editing it Modify a label control by directly editing it in Form Design View or the property sheet in Form Design View or the property sheet for the label.for the label.– The The property sheetproperty sheet is a comprehensive listing is a comprehensive listing

of all of all propertiesproperties (characteristics) that have (characteristics) that have been specified for that control been specified for that control

– Click the label in Form Design View to edit itClick the label in Form Design View to edit it

oror– Double-click the label to open its property Double-click the label to open its property

sheetsheet

Page 18: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

18

Modifying Labels (cont.)Modifying Labels (cont.)

The The CaptionCaption property controls the property controls the text displayed by the label control.text displayed by the label control.

Property sheet

Title bar identifies the

type of control

Caption property

Page 19: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

19

Modifying Text BoxesModifying Text Boxes

Text boxes are generally used to Text boxes are generally used to display form underlying fields and are display form underlying fields and are therefore therefore boundbound to the field. to the field.– A text box control may also serve as a A text box control may also serve as a

calculated controlcalculated control when it stores an when it stores an expressionexpression

• An An expressionexpression is a combination of symbols is a combination of symbols that calculates resultsthat calculates results

• Common expressions include calculating Common expressions include calculating the current date, a grade point average, or the current date, a grade point average, or a page numbera page number

Page 20: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

20

Modifying Text Boxes (cont.)Modifying Text Boxes (cont.)

Expressions start with an equal sign Expressions start with an equal sign (=).(=).– A field name is bracketed within an A field name is bracketed within an

expressionexpression– A field name must be typed exactly as it A field name must be typed exactly as it

appears in the Table Design Viewappears in the Table Design View

Page 21: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

21

Modifying Text Boxes (cont.)Modifying Text Boxes (cont.)

New text box

New label

Toolbox toolbar

Page 22: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

22

Modifying Tab OrderModifying Tab Order

The The tab ordertab order is the order in which is the order in which the the focusfocus (the active control) moves (the active control) moves as you press [Tab] in Form View.as you press [Tab] in Form View.– Change using the Tab Order dialog boxChange using the Tab Order dialog box– To change tab sequence, drag the To change tab sequence, drag the row row

selectorselector up or down up or down

Form sections

Page 23: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

23

Modifying Tab Order (cont.)Modifying Tab Order (cont.)

Drag the row selector to

move the field up or down

Detail section

Page 24: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

24

Entering and Editing RecordsEntering and Editing Records

Forms are used to find, enter, or edit Forms are used to find, enter, or edit records in the underlying record records in the underlying record source.source.

Edit record symbol

Page 25: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

25

Entering and Editing Records Entering and Editing Records (cont.)(cont.)

To find a record, click the Find button on To find a record, click the Find button on the Form View toolbar.the Form View toolbar.

Find button

Find criteria

Page 26: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

26

Inserting an ImageInserting an Image

An example of a graphic image is a An example of a graphic image is a picture, logo, or clip art.picture, logo, or clip art.– Images can be added to bound or Images can be added to bound or

unbound controlsunbound controls• Bound images are tied to a field defined Bound images are tied to a field defined

with an OLE Object data typewith an OLE Object data type

Page 27: Forms Using. 2  Plan a form  Create a form  Move and resize controls  Modify labels  Modify text boxes Objectives.

27

Inserting an Image (cont.)Inserting an Image (cont.)

Inserted logo