ms access how to: basic forms incl....

23
MS Access How To: Basic forms incl. search UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT

Upload: others

Post on 28-Oct-2019

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

MS Access How To:

Basic forms incl. searchUNIT 18 DATABASE DESIGN

EXTENDED DIPLOMA IN ICT

Page 2: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Last week

Complete design work

ERD

Normalisation

Decision explanation

Data dictionaries

calculations

Set –up tables that match data

dictionaries

Add example data

Import data for customers/owners

Page 3: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

The example database

A costume hire database

4 tables

Page 4: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

The example database

A costume hire database

4 tables

Create tblCustomer by importing data

Page 5: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

The data

Page 6: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Referential integrity

Set in the Relationships tab in database tools

1: Create the relationship

by dragging the key in one

table onto the key in the

other table

2: This dialogue box opens

and you click on Enforce

Referential Integrity

Page 7: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Forms - purpose

Enable user

Data entry

Data retrieval

Protect database

Page 8: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 1

On the Create tab choose Form Design to open a new form

design object

Page 9: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 2

In the Property Sheet make sure Form is selected, then choose

the Customer table as the Record Source

Select Form

Select the Customer Table

from this drop down as the

Record Source

Page 10: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 3

In the Property Sheet make sure Form is selected, then choose

the Customer table as the Record Source

Select Form

Select the Customer Table

from this drop down as the

Record Source

Page 11: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 4

Click on Text Box in the Controls ribbon and drag out a text

box on the form

The Property Sheet changes to Text0

In the Control Source select a field

Select a field

Text Box

(selected)Label

Page 12: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 4 notes

The text box was initially ‘unbound’ – not a associated with a

database field

After selecting the field it now uses data from and can pass

data to the selected field

Select a field

Text Box

(selected)Label

Page 13: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 5

Select the label and then change the caption in the property

sheet

LabelCaption

New caption

Page 14: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 6

Switch to Form View and save the form - frmCustomer

Click

hereOr right click

here

Use the record selectors to scroll

through the records

Page 15: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 7

Add the other text boxes and adjust the sizes

Use multiple select to position them and make the sizes equal

(right click when selected)

Page 16: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Search

Form shows all the details for one customer.

Need facility to search

Use combo-box

Page 17: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 8

Drag a combo box onto the form next to the customer last

name. The Combo Box Wizard starts

Combo

Box

Page 18: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 8

The Combo Box will

show the list of last names and

when one is selected, switch to the record that has that last

name

Choose this

option

Page 19: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 9

Select the LastName and then FirstName fields for the Combo

Box. The wizard shows how the box will look.

Page 20: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 10

Choose a suitable label for this box e.g. ‘Search’ or ‘Find’

Provide a

suitable label

Page 21: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 11

You can now search for names

Choose a name from the drop

down, or key in the first letters

But, drop-down list is not easy to search by scrolling through – it is not

alphabetical

Page 22: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 12

To display the names alphabetically, click on the ... in the row source of the Property Sheet. This will open the Query.

Click here

Page 23: MS Access How To: Basic forms incl. searchwiki.hct.ac.uk/_media/computing/btec/level3/l6baccesshowtobasicforms.pdf · UNIT 18 DATABASE DESIGN EXTENDED DIPLOMA IN ICT. Last week Complete

Customer form: 13

Click in the Sort row for LastName and FirstName to sort Ascending. Then save and close the Query.

Click into here then use

the drop down