Microsoft Access 2010 Chapter 3 Maintaining a Database
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 Maintaining a Database2
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 Maintaining a Database3 Objectives
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. Maintaining a Database4 Prepare
Maintaining a Database5 Project – Maintaining a Database Read the project on pg. 138
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 Maintaining a Database6 General Project Guidelines
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. Maintaining a Database7 Creating a Split Form
Maintaining a Database8 Creating a Split Form Do pages
Filtering is simply looking at a subset of the data… Not just a single record, link searching, but a group of records. Maintaining a Database9 Using Filter By Selection
Maintaining a Database10 Using Filter By Selection Do pages
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. Maintaining a Database11 Changing the database structure
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. Maintaining a Database12 Adding fields
Maintaining a Database13 Creating a Lookup Field Do pages
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 Maintaining a Database14 Making Mass changes to a table
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. Maintaining a Database15 Making changes to table structure
Do pages Maintaining a Database16 Modifying data in the table
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 Maintaining a Database17 Updating a Form, datasheet view, and reports to reflect table changes
How do we include Multi-value fields on a single row in a query? Do pages Maintaining a Database18 Querying a Multivalued Field Showing Multiple Values on a Single Row
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 Maintaining a Database19 Specifying Referential Integrity
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! Maintaining a Database20 What is the effect of referential integrity?
Do pages Maintaining a Database21 Ordering Records
Homework/Labs Homework Do Wheel of Terms for Chapter 3 due at the beginning of the next class period. 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 22Maintaining a Database