22
Microsoft Access 2010 Chapter 3 Maintaining a Database

Microsoft Access 2010 Chapter 3 Maintaining a Database

Embed Size (px)

Citation preview

Page 1: Microsoft Access 2010 Chapter 3 Maintaining a Database

MicrosoftAccess 2010

Chapter 3

Maintaining a Database

Page 2: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 2

• Add, change, and delete records• Search for records• Filter records• Update a table design• Use action queries to update records• Use delete queries to delete records• Specify validation rules, default values, and

formats

Objectives

Page 3: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 3

• Create and use single-valued lookup fields• Create and use multivalued lookup fields• Add new fields to an existing report• Format a datasheet• Specify referential integrity• Use a subdatasheet• Sort records

Objectives

Page 4: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 4

• Create a Chapter 3 folder under the Access folder• Copy the Camashly Design database from your

Chapter 2 folder into your chapter 3 folder as a starting point for this chapter.

Prepare

Page 5: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 5

Project – Maintaining a Database

Read the project on pg. 138

Page 6: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 6

• Determine when it is necessary to add, change, or delete records in a database

• Determine whether you should filter records• Determine whether additional fields are necessary or

whether existing fields should be deleted• Determine whether validation rules, default values, and

formats are necessary• Determine whether change to the format of a datasheet

are desirable• Identify related tables in order to implement relationships

between the tables

General Project Guidelines

Page 7: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 7

• What is a split form? A form that allows you to simultaneously view both simple form and datasheet views of the data.

• Now you will create a split form to add, search, update, and delete records.

Creating a Split Form

Page 8: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 8

Creating a Split Form

Do pages 142-147

Page 9: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 9

• Filtering is simply looking at a subset of the data… Not just a single record, link searching, but a group of records.

Using Filter By Selection

Page 10: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 10

Using Filter By Selection

Do pages 148-154

Page 11: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 11

• A field is no longer necessary, additional information is needed, a change in information is needed.

• These all require you to make changes to the tables’ structure.

Changing the database structure

Page 12: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 12

• We will begin by placing lookup fields in our tables. • Lookup field- you type the values that will be a part

of a drop-down box– Multivalued field – More than one value is stored in t he

field• Calculated field – can be calculated from other fields

Normally not a good idea to store these, but you have the ability to do so. Users CAN NOT update this type of field. Access updates it automatically as data that affects it changes.

Adding fields

Page 13: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 13

Creating a Lookup Field

Do pages 155-161

Page 14: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 14

• Update query – allows you to make the same change to all records that satisfy some criterion. – If there is no criterion, the changes will be made to ALL records.

• Delete query – query that will delete all the records satisfying any criterion.

• Append query – add a group of records from one table to the end of another table.

• Make-table query – add records from one table to create a totally new table.

• Do pages 162-164

Making Mass changes to a table

Page 15: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 15

• Changing the field size – simply change the maximum number of characters a user can enter in a field.

• Validation rules – rules a user MUST follow when entering data.

• Validation text – message that will appear if the rules are broken!

• Required field – user MUST enter data.• Range of values – data MUST be within a certain range• Default values – value that will be displayed on the screen in

a field before the user begins adding data.• Can force uppercase characters, etc.

Making changes to table structure

Page 16: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 16

• Do pages 165-174

Modifying data in the table

Page 17: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 17

• The form we created in chapter one isn’t valid anymore. We have added additional fields.

• The easiest way to reflect these changes is to create a new form.

• We will also reflect the table changes in our reports.• Adding totals to a datasheet is also commonly done.• Changing the appearance of a datasheet may also be

necessary.• Do pages 174-182

Updating a Form, datasheet view, and reports to reflect table changes

Page 18: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 18

• How do we include Multi-value fields on a single row in a query?

• Do pages 183-185

Querying a Multivalued Field Showing Multiple Values on a Single Row

Page 19: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 19

• What is referential integrity? The property that ensures that the value in a foreign key must match that of another table’s primary key.

• Foreign key – field who values are required to match the primary key of another table.

• In the Client table, the Business Analyst Number field is a foreign key that must match the primary key of the Business Analyst Table.

• Do pages 187-189

Specifying Referential Integrity

Page 20: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 20

• Any number in the Business Analyst Number field will be rejected if it doesn’t match in the Business Analyst table

• Can’t change an existing # to one that doesn’t exist• Notice the plus (+) sign by each business analyst in

their table. Click on it. This is called a subdatasheet!• Try to change the BA # in the client table to one that

doesn’t exist!• Try to delete a business analyst that has clients!

What is the effect of referential integrity?

Page 21: Microsoft Access 2010 Chapter 3 Maintaining a Database

Maintaining a Database 21

• Do pages 194-195

Ordering Records

Page 22: Microsoft Access 2010 Chapter 3 Maintaining a Database

22Maintaining a Database

Homework/Labs

• Homework• Do Wheel of Terms for

Chapter 3 due at the beginning of the next class period.

• www.scsite.com/ac2010

• Labs• Copy your database from

Chapter 2 and place it in chapter 3 before beginning these 2 projects!

• In the Lab: Lab 3 Philamar• Cases and Places 1: Chamber

of Commerce