You are on page 1of 74

Microsoft Office Access 2007 Lab 1

Creating a Database

McGraw-Hill Career Education

© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved.

1-2

Objectives
1. Plan, create, and modify a database 2. Create and save a table structure 3. Define field names, data types, field properties, and primary key fields 4. Enter and edit data

McGraw-Hill Career Education

© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved.

1-3

Objectives
5. 6. 7. 8. 9. Add attachments Change views Adjust column widths Use the Best Fit feature Create a second table

McGraw-Hill Career Education

© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved.

Close and open a table and database McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. Create a Lookup field 11. Preview and print a table 13. Change page orientation 14. Delete records 12.1-4 Objectives 10. . All Rights Reserved.

. All Rights Reserved. Inc.1-5 Concept Preview ‡ ‡ ‡ ‡ Database Object Data Type Field Property ‡ Primary Key ‡ Lookup Field ‡ Subdatasheet McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

1-6 Outline ‡ Introducing Access 2007 ± Starting Access ± Exploring the Access Window ‡ Creating a New Database ± Planning and Designing a Database ± Creating and Naming the Database McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved. Inc. .

Inc. All Rights Reserved. .1-7 Outline ‡ Creating a Table ± Defining Field Names ± Defining Data Types ± Defining Field Properties ± Entering a Field Description McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

.1-8 Outline ‡ Creating a Table continued ± Defining a Primary Key Field ± Defining Date formats ± Defining Additional Fields ± Editing Field Definitions ± Saving the Table Structure McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved. Inc.

Inc.1-9 Outline ‡ Entering and Editing Table Data ± Using Table Datasheet View ± Entering Data in a Datasheet View ± Editing Data ± Inserting a Picture ± Navigating a Datasheet McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. . All Rights Reserved.

All Rights Reserved. Inc. .1-10 Outline ‡ Changing a Column Width ± Resizing a Column ± Using Best Fit ‡ Adding Records in Data Entry ‡ Deleting Records McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

1-11 Outline ‡ Previewing and Printing a Table ± Previewing the Table ± Changing the Page Orientation ± Printing a Selected Page ‡ Closing and Opening a Table and Database McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. . Inc. All Rights Reserved.

Inc.1-12 Outline ‡ ‡ ‡ ‡ Exiting Access Key Terms FAQs Discussion Questions McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved. .

1-13 Designing a New Database McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. . All Rights Reserved.

place. . All Rights Reserved.1-14 Concept 1 Database ‡ Database ± Organized collection of related information ‡ Table ± Vertical columns & horizontal rows where information is stored ‡ Record DATABASE ± A row ± Information about one person. or thing ‡ Field ± A column ± Smallest unit of information McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc.

Inc. .Creating and Naming the Database File McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved.

.Starting with a Blank Database McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. All Rights Reserved.

. All Rights Reserved.Saving the New Database McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc.

. All Rights Reserved. Inc.Access Application Window McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

1-19 Concept 2 Object McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. . All Rights Reserved. Inc.

. All Rights Reserved.Using the Navigation Pane McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc.

All Rights Reserved. . Inc.Using Datasheet View A visual presentation of the data Consists of rows and columns Header row contains field names Select All button is used to select an entire row ‡ Record number indicator shows the total number of records in the table ‡ ‡ ‡ ‡ McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

. All Rights Reserved. Inc.Access Views McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

Defining Fields McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved. Inc. .

All Rights Reserved. .Entering Data McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc.

All Rights Reserved. Inc. .Changing Field Names ‡ A field name is used to identify data stored in the field ‡ Should describe the contents of the data entered in the field ‡ Name can be up to 64 characters long ± Cannot begin with a space ± Best to use short field names McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

Editing Entries McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. All Rights Reserved. .

Defining Data Type McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. . All Rights Reserved.

1-28 Concept 3 Data Type ‡ Data type defines the type of data the field will contain ‡ Used to ensure right kind of data is entered ‡ Important to choose appropriate data type McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. . All Rights Reserved.

1-29 Data Types Text Memo Number Date/Time Currency AutoNumber Yes/No OLE Object Hyperlink Attachment McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. . All Rights Reserved.

. All Rights Reserved.Data Types TEXT DATA TYPE DATE DATA TYPE McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc.

Inc. All Rights Reserved.Using Field Templates ‡ A list of predefined fields ‡ Each field template definition includes: ± Field name ± Data type ± Settings that control appearance and behavior McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. .

All Rights Reserved. Inc.Field Templates McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. .

Switching Views McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved. . Inc.

Using Design View
‡ Displays the structure of the table ‡ Does not show table data ‡ Used to make changes

McGraw-Hill Career Education

© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved.

1-35

Concept 4
Field Property

‡ Characteristic that defines a field ‡ Each field has a set of properties ‡ Enhances the way table works

McGraw-Hill Career Education

© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved.

Field Properties

McGraw-Hill Career Education

© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved.

. Inc.Modifying Field Properties McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved.

.Changing Data Type McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved. Inc.

. All Rights Reserved.Editing Field Names McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc.

All Rights Reserved. Inc. .1-40 Concept 5 Primary Key ‡ A field that uniquely identifies each record ‡ Most tables have at least one primary key ‡ Requirements ± Key data MUST be unique ± Field cannot be empty or null ± Data in the field rarely changes McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

All Rights Reserved.Defining a Primary Key McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. .

.Entering a Field Description McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. All Rights Reserved.

Entering and Editing Data McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. . Inc. All Rights Reserved.

Verifying Data Accuracy and Validity McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. . Inc. All Rights Reserved.

the first letter of sentences. All Rights Reserved.Using AutoCorrect ‡ Typing errors that can be corrected automatically include « ± Capitalizing names of days. . Inc. and other common typing errors ± Misspellings ‡ AutoCorrect Option button appears next to any text corrected McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

.Attaching a File ‡ A data type that can be a drawing object or a picture ‡ Identified by a paperclip icon in the field header ‡ Used to attach a graphic or a text file McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. All Rights Reserved.

Attaching a File McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. . Inc. All Rights Reserved.

Inc. All Rights Reserved.1-48 Moving between Fields McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. .

. All Rights Reserved. Inc.Zooming a Field ‡ View a field¶s content by expanding it ± Select the field ± Press Shift + F2 McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

. All Rights Reserved.select all columns and change their widths at the same time McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc.Changing Column Width ‡ Resize a column ± drag column border to increase or decrease ‡ Use Best Fit .

.Deleting Records ‡ Remove records by selecting and pressing the Delete key ‡ Click Yes to confirm deletion ‡ Action cannot be reversed McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. All Rights Reserved.

Inc. All Rights Reserved. .Creating a Second Table McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

All Rights Reserved. . Inc.Using the Lookup Wizard McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

All Rights Reserved.1-54 Concept 6 Lookup Field ‡ Provides a list of values ‡ Makes entering data simpler and more accurate ‡ Two types ± Lookup List Lookup Field ± Value List Lookup Field McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. .

. Inc. All Rights Reserved.Using a Lookup Field McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

Inc.1-56 Previewing and Printing A Table ‡ Preview table to save time ± Displays each page in a reduced size ± Can make changes to the layout before printing ‡ Printing a table ± Use the Print button in the Print Group ± Define printer settings ‡ Page orientation categories ± Portrait ± Landscape McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. . All Rights Reserved.

Inc. All Rights Reserved. .1-57 Previewing the Table McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies.

Printing a Table McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved. . Inc.

Print Range Options McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved. Inc. .

1-60 Changing the Page Orientation and Margins McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. All Rights Reserved. .

All Rights Reserved. Inc.1-61 More on Changing the Page Orientation and Margins McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. .

1-62 Closing and Opening a Table & Database Closing a Table & Database Opening a Table & a Database McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. . All Rights Reserved.

1-63 Concept 7 Subdatasheet ‡ A data table nested in another data table ‡ Contains data related or joined to the table where it resides ‡ Allows easy viewing and editing ‡ Created automatically McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Inc. . All Rights Reserved.

Subdatasheet McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. . All Rights Reserved. Inc.

. Inc.1-65 Exiting Access ‡ Click X .Close in the Access window bar ‡ You can also select the Office Button and choose Exit Access McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved.

All Rights Reserved. .1-66 Key Terms ‡ Allow Zero Length property ‡ Attachment data type ‡ AutoNumber data type ‡ Best Fit feature ‡ Caption property ‡ cell McGraw-Hill Career Education ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ Clipboard column width composite key Currency data type current field current record data type database Datasheet view © 2008 by the McGraw-Hill Companies. Inc.

. All Rights Reserved. Inc.Key Terms ‡ Date/Time data type ‡ Default Value property ‡ Design view ‡ destination ‡ drawing object ‡ field ‡ field name ‡ field property McGraw-Hill Career Education ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ field size property field template foreign key form Form view Format property graphic header row Hyperlink data type © 2008 by the McGraw-Hill Companies.

1-68 Key Terms ‡ Indexed property ‡ Input Mask property ‡ landscape orientation ‡ Layout view ‡ lookup field ‡ lookup list ‡ Lookup Wizard ‡ margin McGraw-Hill Career Education ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ Memo data type navigation buttons Navigation pane normal form normalization Number data type object OLE Object data type © 2008 by the McGraw-Hill Companies. . All Rights Reserved. Inc.

All Rights Reserved.1-69 Key Terms ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ orientation picture portrait orientation primary key Print Preview query record record number indicator ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ ‡ relational database report Report view Required property Select All button serial value source subdatasheet table McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. . Inc.

All Rights Reserved. Inc.Key Terms ‡ template ‡ Text data type ‡ Validation Rule property ‡ Validation Text property ‡ value list ‡ view ‡ Yes/No data type McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. .

1-71 FAQs 1. Inc. All Rights Reserved. . What is the file extension of an Access database? 4. Please explain. I am not sure I understand when to use the Attachment data type. What is the difference between a field name and the data stored in the field? 5. Does a database contain one table or several tables? 3. McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. What is a relational database? 2.

Inc. How can I make the field bigger? 10.1-72 FAQs 6. What are Lookup fields and how are they used? McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved. What are field properties? 7. What is a primary key? What is a composite key? 8. . How can I verify that the data entered in a field is accurate? 9. Help! I can¶t see the data in a field.

. Inc.1-73 Discussion Questions 1. What are subdatasheets? Give examples of how they are used. McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. All Rights Reserved. Discuss why it is important to plan a database before creating it. 2. Discuss three ways of creating a database. How can proper planning save you time later? 3.

Inc. All Rights Reserved.1-74 Discussion Questions 4. Discuss why it is important to choose the correct data type for a field. Design view and Datasheet view are two views in Access. . 5. What may happen to the data if you change the data type later? McGraw-Hill Career Education © 2008 by the McGraw-Hill Companies. Discuss when it would be appropriate to use each of these views.