ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

110
ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View

Transcript of ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Page 1: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

ACG 4401

Access 2007

Tables Part I

Datasheet vs. Design View

Page 2: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Creating the Database

Start Access Getting Started Page Appears

Choose Blank Database Type in filename

Extension will be .accdb Choose your folder

Click Crate Button

Page 3: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Backing up the Database

Office Button Manage

Back Up Database

Page 4: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

What the database file contains?

Tables New database starts with one (blank)

Forms Reports Queries Macros Modules

Page 5: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Creating Tables

Datasheet View Fast and Easy

Similar in Appearance to Excel Columns become fields

Drawbacks Data types are “guessed” by Access

Design View Full Control over each field in your table Full control over Data Types Full control over other Field Properties

Page 6: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Datasheet – Creating Table

Select your table (or create a new one) Enter data in each column Use a different column for each field Add Column Names

These will be the names of your fields in your table

Double-click the column heading and edit Save your table

Page 7: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Multiple Datasheets

Each table will appear as a Tab (Access 2007)

Each table will appear as a separate Window (Access 2003 or earlier)

Page 8: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Design View

Complete Control over the structure of your Tables Fields/Attributes

Data Types Other Data Properties

Used to: Add Fields

End of Table Move to last row of field list

Between Fields Move to the row below where you want the new field

Right-click, Choose Insert Rows Rearrange Fields

Just drag and drop Delete Fields

Page 9: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Fields Descriptions

Description will appear in the Status Bar Control: Provide prompting/feedback to

users

Page 10: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

For Each Field

Enter Field Name Enter Data Type Enter Description (optional) Enter/Change Data Type Properties

Page 11: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

What are the Data Types

Text Memo Number Currency Date/Time Yes/No Hyperlink Attachment AutoNumber OLE Object

Page 12: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Text

Any Character accepted Limited to 255 characters

~ 1 paragraph Properties:

Text Length For most fields use 50 If you know exact length (e.g. SS#) use the

exact length (e.g. 9)

Page 13: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Memo

Used to store a large amount of Unformatted text 65k worth of data ~ 1 average book chapter

To Edit large blocks of text (or anything) Shift-F2

Page 14: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Number Field Size depends on Number Type

Byte 0-255 No decimals

Integer -32,768 – 32,768 No decimals

Long Integer (Access Default) -2,147,483,648 – 2,147,483,648 No decimals

Single (Best choice for decimals) +/- up to 38 zeroes Decimals to 7 places

Double +/- up to 308 zeroes Decimals to 15 places

Decimal +/- up to 28 zeroes Decimals to 28 places

Page 15: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Currency

Most Efficient for Financial Calculations

Page 16: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Date/Time

Access stores the Date and Time Choose how it’s Displayed in the

Format Field

Page 17: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Yes/No

Any field that can be one of two states Yes/No On/Off True/False Male/Female

Page 18: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Hyperlink

URL File Address Email Address

Page 19: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Attachment

Access Stores the file inside the database Pictures Music Files Word Files Excel Files

Page 20: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

AutoNumber

Remember Primary Keys Access automatically creates this field type

when you crate a new Table Unless: Create>>Tables>>Table Design

Default is sequential numbering Two Options

Random # Replication ID

Guaranteed to be unique Useful if database is distributed but will later be

merged

Page 21: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Access 2007

Tables Part II

Data Input Controls

Page 22: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Input Control

From Design Format the Datasheet

Home>Font Gridlines Every other Row Color Fonts Text Color Background

Page 23: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Data Entry Controls

Preventing Blank Fields Required Property Allowed Zero Length

Preventing Duplicate Values Default Values Input Masks Validation Rules Lookups

Page 24: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Preventing Blank Fields

For any required field Change Required Property to “Yes”

But Access considers “ “ to be data Change Allow Zero Length Property to

“No” This also works for number field types if you

want do not want to accept “0” as a number

Page 25: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Preventing Duplicate Values

Indexed Property Sorts a field in your table

Improves Performance when searching/querying

Three Options No (Default) Yes [Allow Duplicates] Yes [No Duplicates]

Page 26: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Default Values

Eliminates Need for User Input Use Default Value Property

Same data is usually entered For Example, Orlando for city

Dynamic default values Access inputs the data but it changes based on

condition Date() Today's date is entered

Text default values must be enclosed in “”

Page 27: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Input Masks

Enforce data value pattern Phone Number

(407) 823-5739 (999) 000-0000

Social Security Number 111-23-7456

999-99-9999

Inventory Item Number MB678-Z123

>LL999->L999

Page 28: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Input Mask

Open table in Design View Select field that will have pattern Choose Input Mask Property Click on the small ellipse ... Choose from the Access provided Masks or Create

your Own Choose how to store the Data

Store only the data 4078235739

Store the data and extra characters (407) 823-5739

Page 29: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Creating Your Own Mask

Placeholders Where should the user input data, and what type

of data is allowed Special Characters

How to treat data that is entered in the mask Literals

Formatting for the mask () in phone number, - for SS #

Page 30: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Placeholder CharactersCharacter Description

0 A required digit

9 An optional digit

# An optional digit or + or -

L A required letter

? An optional letter

A A required letter or digit

a An optional letter or digit

& A required character of any type

C An optional character of any type

Page 31: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Special Characters

Character Description

! Mask is filled left to right

< Converts all characters that follow to lowercase

> Converts all characters that follow to uppercase

Password Any character typed in is replaces on screen with a *

Page 32: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Field Validation Rules

Restrict data allowed If data matches rule it can be entered If data does not match rule Access keeps it out

Applying Validation Rule Open table in Design View Select field Go to Validate Rule Property

Type Expression

Type Error Message in Validation Text Property

Page 33: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Writing Expressions Validating Numbers

<, >, <>, <=, >=, =, Between Validating Dates

Dates must be entered between ## #05/23/2008#

<, >, <=, >= Date Functions

Date () Today’s date, one second after midnight Now(0 Today’s date and current time

<, > Validating Text

Starts with Ends with Contains

Like Operator and * wildcard or ? Single character Combining Validation Conditions

And Or

Page 34: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Validating Text Examples

Start of text Like “ACG*”

End of text Like “*4401”

Contains text anywhere Like “*A*B*”

Contains text specific place Like “????7Y2”

if 1st 4 characters are text Like “####7Y2”

if 1st 4 characters are numbers Restrict character to certain letters or symbols

Like “[AE]*” Must begin with A or E

Like “[ABCD]*” or Like “[A-D]*” Must begin with A, or B, or C, or D

Page 35: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Table Validation Rules

Allows comparison of multiple fields from a table For example:

Ship Date can NOT be before Order date Validation Rule = Order Date < Ship Date

To create table validation rule Open table in Design View

Table Tools > Design > Show/Hide > Property Sheet Set Validation Rule Set Validation Text

field names must appear between [] [DateOrdered] < [DateShipped] or [DateOrdered] <= [DateShipped]

Page 36: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Lookups

Helps to standardize data Enter a value by choosing from a list Two Types

List has fixed set values List comes from another table

Page 37: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Fixed Lookup Lists

Open Table in Design View Go to field which will have lookup Change Data type to Lookup Wizard Choose “I will type in the values that I

need” Enter the values Choose if lookup can store multiple

values

Page 38: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Lookup List Property

Disable user ability to add to or override list Set the Limit to List property = “Yes”

Allow list modification Set the Limit to List property = “No”

Page 39: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Access 2007

Tables Part III

Linking Tables

Page 40: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Defining a Relationship Each relationship links two tables

Primary Key from one table Foreign key from another table

Primary key value from 1st table Choose:

Database Tools > Show/Hide > Relationships Add tables that participate in relationship Drag the field from one table (the one side) to the related field in

the other table (the many side) Edit relationship

Set Enforce Referential Integrity Prevents Insert, Deletion or Update anomalies

Cascade Deletes You don’t want to do this, but...

It deletes every record in all related tables Cascade Updates

Any changes made in a link field (the one side) are automatically made in the linked field (the many side)

Page 41: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Lookups with Related Tables

2nd Lookup Option Data values come from related table You must remove any defined relationship before doing the

lookup Same steps as Lookup described earlier

Choose “I want the lookup column to look up values in a table or query”

Choose the table Choose the field for the lookup Choose a field that describes the lookup field Choose a field to sort Choose “Hide Key Column” Name the lookup Finish

Page 42: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Access 2007

Queries

Page 43: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Types of Queries

Select Display data that matches criteria

Action Queries Append data Delete data Update data

Matches criteria

All Queries are Objects stored in the database

Page 44: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Steps to Create Select Query

Create > Other > Query Design Select table(s) Select fields you want displayed

Double click or Drag Choosing * field will select all fields

Arrange fields from left to right Best done by selecting in order you want But you can drag fields around to re-arrange

To Hide a Column Uncheck the Show checkbox

Choose a field to sort by Create your Criteria Run Your Query Save the Query

Page 45: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Join Queries

Combine two related tables Primary key Foreign key

Just add two (or more) tables to your Query Design

Create Relationship If relationship doesn’t already exist

Everything else is the same.

Page 46: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Inner Joins vs Outer Joins

Inner Joins Only shows linked records

Each Inventory item related to a Vendor Each Sales order related to a Customer

Outer Joins Show linked records AND Other records from one of the two linked tables

All Sales order that match a criteria based on Customer AND remaining Customers not linked to a Sales Order

Page 47: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Creating Outer Joins

Right Click Join line in Query Choose:

Only choose rows where joined fields from both tables are equal (inner join)

Include All records from “xxxxx” table and only those records from “yyyyy” table where joined fields are equal (outer join)

Include All records from “yyyy” table and only those records from “xxxx” table where joined fields are equal (outer join)

Page 48: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Creating a Calculated Field

Two Parts: Calculated field name: Expression

Using field names for the table(s) Enclose in [] and

[TableName.FieldName] [Customer.FirstName]

Page 49: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Math Expressions

+ - * / ^ - Exponentiation 22

\ - Integer Division 5/2 = 2 Mod – Modulas 5/2 = 1 (the remainder)

Page 50: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Writing Expressions

Long Expression? Shift-F2

Page 51: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Expressions with Text

& Joins or concatenates fields together Fullname: [FirstName] & “ “& [LastName]

Page 52: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Query Functions

Function Name() Inside () put in parameters (if any) that

are needed Expression Builder

Right Click empty field box in Query Design

Build Add/Edit the experssion

Page 53: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Formatting Expressions

Format(Number, format) Currency Fixed Standard Percent Scientific Yes/No

No if number is 0 Yes if number is anything else

Page 54: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Math Functions

Sqr() Square root

Sqr(9) Abs()

Absolute Value Round()

Round(number, # of decimal places) Val()

Converts text field number to number for a calculation

Page 55: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Text Functions

Ucase(text) Capitlizes text

LCase(text) Changes text to lowercase

Left(text,Number) Starting from left, get’s number of characters

Right(text, Number) Starting from end, gets number of characters

Mid(text, startnumber, endnumber) Trim(text)

Removes blank spaces from either side Len(text)

Counts number of characters

Page 56: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Date Functions

Date() Now() DatePart(partofmonth,

date) yyyy – 4 digit year q – Quarter 1 to 4 m – month, 1-12 y – Day of year, 1-365 d – Day , 1-31 w – Day of week, 1-7 ww – Week of the year, 1-

52 h – hour, 1-24 n – Minute, 1-60 S – Second, 1-60

DatePart(“m”, [DatePlaced]=DatePart(“m”, Date()) And DatePart(“yyyy”, [DatePlaced]=DatePart(“yyyy, Date())

The order was placed in the same month and year as today's month and year

Page 57: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Other Date Functions

DateSerial() DateAdd() DateDiff() MonthName() WeekdayName() Format()

Page 58: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Blank Values

Finding blank values Is Null

Nz() Two Parameters

Value (usually a field from your query) What to replace that field with if its Null

0 is the default so you can leave this parameter out

OrderItemCost: Nz([Quanity]) * Nz([Price])

Page 59: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Summarizing Data

Count Sum Average Maximum Minimum First Last Group By

1. Create Query

2. Add table(s)

3. Add fields

4. Query Tools|Design > Show/Hide > Totals

5. Total row appears in Query Design form

Page 60: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Total Query Quirks

Each field in the design must be: Used in a Summary Calculation Used for Grouping (Sorting) Used for Filtering

Page 61: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Query Parameters

Flexible Queries User Supplied Criteria Steps

1. Create Query2. QueryTools | Design > Show/Hide >

Parameters3. Choose name and data type for parameter

1. Data type should match the field data type that you are using the parameter for

4. OK5. Run The Query

Page 62: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Access 2007

Forms

Page 63: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Why Use Forms

Ease of Use Reviewing Editing Data Entry

Input Process Control

Page 64: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

A Simple Form

Two Types Stacked

Each Field is listed top to bottom One Record per screen (default)

Tabular Each Field name becomes a Column Record’s listed in rows Similar to DataSheet

Page 65: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Create a Simple Form

Select Table Create > Forms > Form Changes to the Form:

Arrange field placement (dragging) Adjust column widths Edit field header text Adjust formatting

Fonts, Colors, etc.

Page 66: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Different Form Views

Form View Where you Review, Add, Edit data

Layout View See what your form looks like with Live

data Design View

Total control over the form No Live Data

Page 67: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

The Layout

Container for various controls on the Form: Widen one field all others are widened Move the layout all fields are moved Rearrange a field in the layout, consistent

spacing is maintained Create > Forms > Form

Creates One Layout container You might want more to aid in form design

Page 68: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Using Multiple Layouts

Open form in Design View Resize for to eliminate all Blank Spaces

Open Property Sheet for Form Choose Form Format Tab Default View Continuous

To do this from the beginning Create > Forms > Multiple Items

Page 69: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Split Forms

Two Views of Data Datasheet Form Layout

Create > Forms > Split Form

Page 70: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Split Form Properties

Orientation Top, Bottom, Left, Right

Size Controls size of datasheet

Datasheet Read Only

Prevents editing to data in the datasheet

Page 71: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Other Form Properties

Source Where does the data come from

Table or Query Allow Edits

No Can’t change anything, but can copy

Allow Deletions No, Can’t Delete

Allow Additions No, Can’t add new records

Data Entry Yes, the form can only be used to enter data Form opens blank, no data

Page 72: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Access 2007

Advanced Forms

Using Design View

Page 73: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Design View

No Layout Access Created Container for Fields

More Control Types More Responsibility To crate a form in Design View:

Crate – > Forms -> Form Design

Page 74: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Control Types

Label Fixed Text, anywhere

Text Box Displays value of field Combines with Label

Check Box Checked for Yes Unchecked for No

Toggle Button Depressed for Yes Not-pressed for No

Line and Rectangle Use to separate sections on

the form

Combo Box Displays list from drop-down

box User Supplied Table or Query Automatically uses for:

Lookup fields Linked tables

List Box Displays entire list on form

Tab Control Create Tabbed pages on a

form Subform

A form inside a form Usually linked records from

related table

Page 75: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Adding Controls to your Form

1. Design Tools|Design > Control2. Select control you want (click it)3. Move control to position on form (release

mouse)4. Complete Control Wizard (if any)5. View Property sheet for Control6. Modify property settings7. Change name of control8. Format control (optional)

Page 76: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Bound vs. Unbound

Bound Control Displays value from a field Changes field value Adds new data to a field

Unbound Not linked to any field in the table/query

Page 77: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Control Steps

1. Create a Control

2. Move a Control

3. Resize a Control

4. Modify a Control

5. Delete a Control

Page 78: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Changing multiple controls

Select group of controls Selection Box Align to Left, Right, Top, or Bottom edges

Sizing To Widest, To Narrowest, To Tallest, To Shortest

Spacing Design Tools | Arrange > Position

Make Vertical Spacing Equal Make Horizontal Spacing Equal Increase Vertical/Horizontal Spacing Decrease Vertical/Horizontal Spacing

Page 79: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Form Sections

Detail Most data fields from table/query

Header/Footer Title Summary Information To create

Right click on Form Choose Page Header/Footer

Page 80: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Tab Order

Tab Key Moves cursor to

next field on form Net field may NOT

be next closest If you moved fields

around

Fields controls are numbered In order of creation

To Control Tab Order Right-click on form Choose Tab Order Choose Details

Section Auto Order

Access sets order

Drag control to corrected order

Page 81: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Tab Control Properties

Tab Stop (No) cursor never goes to control;

Auto Tab (only used with Input Mask) once field is complete Tab automatically

moves to next control Tab Index

change the index number of the control

Page 82: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Locked Vs. Enabled Controls

Locked “Yes”, Can’t edit the field You can copy the field contents

Enabled “No”, dims control No interaction, Can’t edit & Can’t Copy

Page 83: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Performing Calculations

Text Box Control Unbounded In Property Sheet, go to Data tab

Add Expression in Control Source

Page 84: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Using the Tab Control

If you have a lot of data to display Not usually to add new data

Tabs allow you to utilize limited space And organize related data

Page 85: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Navigation Form using Lists

Make sure Control Wizard is on Choose List box or Combo Box

Combo Box saves screen space Place control on the form Wizard appears:

Find a Record on my Form Choose field to use for Lookup Make sure Hide Key column is checked Enter Text Caption Finish

Page 86: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

The Subform Control

Form with a form Usually the Many part of a 1:M

relationship 1: part is created as a form with controls

used to create a well designed form :M part typically uses data sheet view

But can use a designed form as well Usually would change property to continuous

display

Page 87: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Creating SubForm

Form Design Tools | Design > Controls Adding manually

Source Object Table or Query

Displays as Datasheet Designed Form

Displays customized form Link Master Field

Field in the form that links to related records in the sub-form

Link Child Field Field in sub-form linked to related record(s) in the

main-form

Page 88: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Command Buttons

User Triggered Actions Open a Form Run a Query Run a Report

Types of Actions Record Navigation Record Operations Form Operations Report Operations Application Miscellaneous

You can use these controls to create a menu system More about this later.....

Page 89: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Access 2007

Using Forms to Build a Menu

Page 90: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

SwitchBoard

A special Form with Command Buttons One Page is Default Can have unlimited Pages

Menu Sub-Menu

Page 91: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Creating SwitchBoard

1. Database Tools > Database Tools > SwitchBoard Manager

2. Choose Yes to Create one3. Or Click Edit if one Exists4. New, to create new Menu5. Write Menu Text and Choose

Command option6. Close

Page 92: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

SwitchBoard Options

Go to Switchboard Used to navigate to/from menu and sub-

menu pages Open Form in Add Mode Open Form in Edit Mode Open Report (in Print Preview mode) Exit Application Run Macro or Run Code

Page 93: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Starting Access with Switchboard

1. Choose Office Button > Access Options

2. Click Current Database3. Applications Options > Display Form

box1. Choose Switchboard Form

4. Optionally, clear checkbox for navigation pane

Page 94: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Ensure your Switchboard appears on Top of open windows

Open Switchboard in Design View Go to form properties Other Tab Pop up to “Yes”

Page 95: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Access 2007

Creating Reports

Page 96: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Create a Simple Report

1. First select your Table or Query

2. Create > Reports > Report

3. Resize columns if needed

4. Rearrange columns if needed

5. Change Formatting

6. Save Report

Page 97: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Report Views

Report View Layout View Design View Print Preview View

Page 98: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Formatting Reports

AutoFormat Entire Report

Report Layout Tools | Formatting > AutoFormat > AutoFormat list

Format Columns and Headers Select what you want to format Choose Font section in Ribbon

Alternate Row Formatting Click to the left of any row Font > Alternate Fill button

Select color

Page 99: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Conditional Formatting

Define a condition and if its True Access applies formatting to the ‘true’ values

To do: Select a Value in the column you want to apply

conditional formatting Report Layout Tools | Formatting > Font > Conditional Set the conditions

Evaluate data from field, “Field Value Is” Use data in calculation, “Expression Is”

Set the Formatting Add 2nd or 3rd Conditions Click OK

Page 100: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Access 2007

Designing Advanced Reports

Page 101: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Report Sections

Report Header Appears once at beginning of the report

Page Header Appears before detail at the stat of each new page

Detail Repeats for each record that appears in your report

Page Footer Appears after detail at the end of each new page

Report Footer Appears once at the end of the report

Page 102: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Report Controls

Label Text Box Image Rectangle Page Break

Page 103: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Creating a Mailing Label Report

Use Label Wizard Select table/Query to use Create > Reports > Labels Follow Wizard

Page 104: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Report Grouping

Why create a Report vs. a Form? Grouping! Arrange data in small sorted groups

You can Create Total Queries or Reports with Groups

Page 105: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Creating Reports with Groups

1. Create a Report

2. Switch to Layout or Design View

3. Choose a field to sort the form by Right Clicking the Field

4. Choose the field to group by Right Clicking

Page 106: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Group, Sort, Total

Extra sorting within a group Summary calculations for group Force page breaks for each group Report Design Tools | Design >

Grouping & Totals > Group & Sort or Report Layout Tools | Formatting >

Grouping & Totals > Group & Sort

Page 107: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Sort by

Chooses the field to sort report by

Page 108: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Group on

Choose a Field to Group by By Entire Value

Creates a group for each unique value in the field

Group a Range of Values Creates a group for values in a field that is

within a range Use for Numbers and/or Dates fields

Page 109: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

With...

Subtotals most common Title

Creates a header/footer for each group section

Keep group Together on a page

Page 110: ACG 4401 Access 2007 Tables Part I Datasheet vs. Design View.

Multiple Groups

Just click on the next field you want to group by....