Chapter 1 Databases and Database Objects: An Introduction MICROSOFT ACCESS 2010
Dec 19, 2015
CY Lin 2
Design a database to satisfy requirements
Describe the features of the Access window
Create a database
Create tables in Datasheet and Design views
Add records to a table
Close a database
Open a database
Print the contents of a table
Create and use a query
Create and use a form
Create and print custom reports
Modify a report in Layout view
OBJECTIVES
CY Lin 4
GENERAL PROJECT GUIDELINES
Identify the tables Determine the primary keys Determine the additional fields Determine relationships between the tables Determine data types for the fields Identify and remove any unwanted redundancy Determine a storage location for the database Determine additional properties for fields Determine the best method for distributing the
database objects
CY Lin
CREATING A DATABASE
With a USB flash drive connected, ensure the New tab is selected in the Backstage view and that Blank database is selected in the New gallery
Click the Browse button in the right pane to display the File New Database dialog box
Type the desired fi le name in the File New Database dialog box. Do not press the ENTER key after typing the fi le name
Navigate to the desired save location Click the OK button Click the Create button in the right pane of the
New gallery5
CY Lin
MODIFYING THE PRIMARY KEY
Right-click the column heading for the desired primary key field (the existing ID field)
Type the new desired name for the field
Click the white space immediately below the field name to complete the addition of the field
Click the Data Type box arrow (Table Tools Fields tab | Formatting group)
Click the desired data type
7
CY Lin
MODIFYING THE PRIMARY KEY
Click the Field Size text box (Table Tools Fields tab | Properties group) to select the current field size, and type the new field size
Click the Name & Caption button (Table Tools Fields tab | Properties group)
Click the Caption text box, and then type the desired caption
Click the Description text box, and then type the desired description
8
CY Lin
DEFINING THE REMAINING FIELDS
Click the Click to Add column heading
Click the desired data type
Enter the desired field name
Click the white space below the field name to complete the change of the name. Click the white space a second time to select the field
Change the field size, if necessary
10
CY Lin
SAVING A TABLE
Click the Save button on the Quick Access Toolbar
Type the desired fi le name
Click the OK button
11
CY Lin
VIEWING THE TABLE IN DESIGN VIEW
Click the View button arrow (Table Tools Fields tab | Views group)
12
CY Lin
ADDING RECORDS TO A TABLE
Right-click the table in the Navigation Pane
Click the Shutter Bar Open/Close Button to close the Navigation Pane
Type the desired values in each field, pressing the TAB key to move to the next field
14
CY Lin
RESIZING COLUMNS IN A DATASHEET
Point to the right boundary of the field selector so that the mouse pointer becomes a two-headed arrow
Double-click the right boundary of the field selector to resize the field so that it best fits the data
Save the changes to the layout by clicking the Save button
Click the table’s Close button to close the table
15
CY Lin
PREVIEWING AND PRINTING THE CONTENTS OF A TABLE
Open the Navigation Pane and select the table you wish to preview and print
Click File to open the Backstage view
Click the Print tab in the Backstage view
Click the Print Preview button
Click the Print button to display the Print dialog box
Click the OK button to print the table
Click the Close Print Preview button to close the Print Preview window
16
CY Lin 17
Open the Navigation Pane
Click Create on the Ribbon
Click the Table Design button (Create tab | Tables group)
Type the desired field name in the Field Name column
Click the Primary Key button if the field is the primary key
Type the desired description in the Description column
Type the desired field size in the Field Size text box
Type the desired caption in the Caption text box
CREATING A TABLE IN DESIGN VIEW
CY Lin
IMPORTING AN EXCEL WORKSHEET
Click External Data on the Ribbon Click the Excel button (External Data tab | Import &
Link group) Click the Browse button to display the File Open dialog
box Navigate to and select the desired fi le Click the Open button (File Open dialog box), which will
return you to the Get External Data dialog box Follow the remaining steps in the wizard to import the
Excel worksheet Choose where to import the data Preview the data you are importing Name the table (if importing to a new table)
19
CY Lin
USING THE SIMPLE QUERY WIZARD TO CREATE A QUERY
Open the Navigation Pane
Select the table you wish to query
Click Create on the Ribbon
Click the Query Wizard button (Create tab | Queries group) to display the New Query dialog box
Click the OK button (New Query dialog box) to display the Simple Query Wizard dialog box
Follow the remaining steps in the wizard to finish creating the query
20
CY Lin
USING A CRITERION IN A QUERY
Right-click the query to open in the Navigation Pane
Click Design View on the shortcut menu to open the query
Click the Criteria row in the column for the field for which you want to specify the criteria, and then type the criteria
22
CY Lin
CREATING A FORM
Select the table in the Navigation Pane for which you want to create a form
Click Create on the Ribbon
If the form appears in Layout view, click the Form View button on the Access Status bar
Click the Save button on the Quick Access Toolbar
Type the desired form name, and then click the OK button
Click the Close button for the form to close the form
24
CY Lin
CREATING A REPORT
Select the table in the Navigation Pane for which you want to create the report
Click Create on the Ribbon
Click the Report button (Create tab | Reports group) to create the report
Click the Save button and then type the name of the report
Click the OK button
26
CY Lin
MODIFYING COLUMN HEADINGS AND RESIZING COLUMNS
Right-click the report in the Navigation Pane you wish to modify and then click Layout View on the shortcut menu
If a Field list appears, click the Add Existing Fields button to remove the Field list from the screen
Close the Navigation Pane
Click the column heading you wish to modify two times
Type the new column heading
Point to the right/lower boundary of the field you wish to resize until the mouse pointer changes to a two-headed arrow and then drag the boundary to the desired position
28
CY Lin
ADDING TOTALS TO A REPORT
Select the field you want to total
Click Design on the Ribbon
Click the Totals button (Report Layout Tools Design tab | Grouping & Totals group) to display the list of available calculations
Click Sum to calculate the sum
Click the Save button to save your changes to the report layout
30
CY Lin
CHANGING DATABASE PROPERTIES
Click File on the Ribbon to open the Backstage view
Click the Info tab in the Backstage view
Click the ‘View and edit database properties’ link in the right pane of the Info gallery
Enter the desired database properties
Click the OK button to save your changes
32
CY Lin
BACKING UP A DATABASE
Open the database to be backed up
Click File on the Ribbon, and then click the Save & Publish tab
With Save Database As selected in the File Types area, click Back Up Database in the Save Database As area, and then click the Save As button
Selected the desired location in the Save As box. If you do not want the name Access has suggested, enter the desired name in the File name text box
Click the Save button to back up the database
33
CY Lin
COMPACTING AND REPAIRING A DATABASE
Open the database to be compacted
Click File on the Ribbon to open the Backstage view, and then, if necessary, select the Info tab
Click the Compact & Repair Database button in the Information gallery to compact and repair the database
34