databases,tables and forms access text by grauer chapters 1 & 2

18
Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Upload: harry-holmes

Post on 04-Jan-2016

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Databases,Tables and Forms

Access Text by GrauerChapters 1 & 2

Page 2: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Introduction to a Database

Defining a database Creating a database in Access Creating forms Using forms to filter data

Page 3: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Database Provide a way to store

a related set of data

Simplest form is a card file Each card a record

Data may be text, dates, numbers, web links, pictures, etc.

Name: ________________

Address: ________________

City: ________ State: ___ Zip: ______

Member since: ______________

Dues paid? ______

Each item a field

Page 4: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Two Types of Database Flat File - Spreadsheet

Works well until data repeats Must enter data repeatedly Data must match exactly

Page 5: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Two Types of Databases

CustomersCustomer IDNameAddressCityStateZip

InvoicesInvoice No.Part No.Unit PriceUnitsCustomer ID

Relational – 2 or more linked tables

Key Field

One-to-Many Relationship

Link PartsPart No.DescriptionSupplierUnits In Stock

Many-to-Many Relationship

Page 6: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Database Window

Database Window

Menu Bar

Toolbar

Object Buttons

Page 7: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Creating a Table

Designing a table yourself Field names Data types Primary key Properties

Views--Datasheet or Design

Using Table Wizard

Page 8: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Design ViewPrimary Key

Field Properties

Data Type

Description

Field Names

Page 9: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Data Types Number Text Memo Date/Time Currency Yes/No AutoNumber OLE Hyperlink

Page 10: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Properties

Field size Format Input Mask Caption Default

Value

Validation Rule Validation Text Required Allow Zero

Length Indexed

Page 11: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Format vs. Input Mask Format - Defines how data will be

displayed Data stored: 123456789 Format: ###\-##\-#### Displays: 123-45-6789

Input Mask - Displays formatting for input Causes format to appear on forms, tables Input Mask: SSN 000-00-0000 Form field shows: SSN ___ - __ - ____

You fill in the underscored blanksOnly the info in the blanks is stored

Page 12: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Table Design Basics

Include all necessary data Use descriptive names Store data in smallest parts

Will you ever need to sort by part? Store address, city, state, zip

separately. Don’t store info based on other data

Don’t store “Age” – age changes! Store DOB, calculate Age

Page 13: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Datasheet View

Total Number of Records

Current Record

Triangle indicatesdata has been saved to disk

Each column is a field

Each row is a record

Page 14: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Database Forms Each page shows

one record Field data appears

in text boxes Other controls can

be added as in Excel user forms

Page 15: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Creating a Form Controls--objects Bound control has data source Unbound control: no data source Calculated control: expression as

data source Properties Form Wizard

Page 16: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Form Wizard

Sizing handles

Label (unbound)Text Box(bound to field)

Click and drag to move Toolbox

Go To First Record

Go To Next Record Go To Last Record

Page 17: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Advanced Forms

Advanced forms use other controls

Combo Box(Drop Down List)

Option GroupCheck box

Command Button

Page 18: Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2

Filter by Form No query needed Allows user to define a limited

subset