25
Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Embed Size (px)

Citation preview

Page 1: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Introduction to Access

By Mary Ann Chaney and

Alicia Harkleroad

Page 2: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Microsoft Access

• Microsoft Access is a powerful program to create and manage your databases. It has many built in features to assist you in constructing and viewing your information.

Page 3: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

First of all you need to understand how Microsoft Access breaks down a database. Some keywords involved in this process are: Database File, Table, Record, Field, Data-type .

Database File: This is your main file that encompasses the entire database and that is saved to your hard-drive or floppy disk. (Example: video.mdb )

Table: A table is a collection of data about a specific topic..

Field: Fields are the different categories within a Table. Tables usually contain multiple fields.

Datatypes:Datatypes are the properties of each field. A field only has 1 datatype. (text, number…)

Page 4: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Creating a Blank Database

• Open Access by either double clicking on the icon or click the Start button on the taskbar, point to All Programs, Microsoft Office and click on Microsoft Access.

• Choose the Create a New File option.

Page 5: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

• Choose the Blank Database option and notice that the File New Database box appears.

Page 6: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Creating a Blank Database• Save the new database to your file storage

location. In this case, School Nutrition.• After saving the file, the Access database

window will appear.

Page 7: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Creating a Blank Database• Double click on “Create table in design view.”• A blank table will open and then you will design

the table structure by Naming Fields and defining Data Types.– Each field will have a unique name.– A field can contain up to 64 characters and can

contain letter, numbers spaces and most punctuation marks. Field names cannot contain periods, exclamation marks or square brackets.

Page 8: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Data Types

• Each field is assigned a data type that determines the type of data the field may contain.

• The most common types are listed below:– Text: can contain any type of character.– Number: can only contain numbers and typically used in

calculations.– Currency: can be used in calculations. Access formats the

numbers in currency field with dollar signs, commas, decimal points and digits following the decimal point.

– Date/Time: can contain dates and times. Dates can be used in calculations. For example, you can subtract two dates to determine the number of days between the dates.

Page 9: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Defining Fields• Type SSN as the field name.• Tab over to the Data Type box.• Select Text from the drop down menu.• Tab to the description box if you wish to make notes.• The field size can be changed if necessary.

Page 10: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Defining Fields• Click in the next Field Name box and type Date

of Hire.• Tab over to Data Type and change the type to

Date/Time. Click in the Format box, choose Short Date.

Page 11: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Primary Keys

• Most Access tables have one field defined as the primary key. The field chosen to be the primary key field must contain unique data; for example, numbers or codes.

• The Primary Key for the School Nutrition Table will be Social Security Number.

• You cannot designate a field like Name as the primary key because more than one person can have the same name.

Page 12: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Defining a Primary Key• Click in the field name box that you want to

make the primary key (SSN for SN Table).• Click the Primary Key button on the Access

toolbar.

Page 13: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Entering Data in Datasheet View

• Design view was used to set up the School Nutrition table. However, to enter data into the table, you must display the table in Datasheet view.

• Once a table is opened in Datasheet view, you can enter data the same way it is entered into an Excel worksheet. The Tab key can be used to move forward one table cell. You can also click in any cell and enter new data or edit existing data.

Page 14: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

• Design View

• Datasheet View

Page 15: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Modifying and Maintaining Tables

• Adding a record– Click the New Record button on the toolbar

while in datasheet view.– Key the data in the appropriate field and then

save the table again.

Page 16: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Modifying and Maintaining Tables

• Deleting a record– Click in the row you want to delete.– Click the Delete Record button on the toolbar.

Page 17: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Modifying and Maintaining Tables• Finding Records

– Click the Find Button on the toolbar while in Datasheet view.

– At the Find and Replace dialog box, type the information you want to find or a portion of it and then click the Find Next button.

Page 18: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Modifying and Maintaining Tables• Finding and Replacing Records

– Click the Find button on the toolbar while in Datasheet view.

– At the Find and Replace dialog box, Type what you want to find (i.e. Unknown in the sex row).

– Click the Replace tab, Type what you want to replace the current information with (i.e. Female).

Page 19: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Queries

• Queries are an essential part of any Access database.

• Queries allow you to extract (pull out) specific data.

• When you run a query, Access creates a temporary table using the field and criteria you specify in the query. The temporary table is known as a record set.

Page 20: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Queries• Designing a Query

– Open the database file (School Nutrition)– Click the Queries button on the Objects bar.– Double click the Create Query in Design View.

Page 21: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Queries– The Query window will appear and the Show

Table dialog box will be displayed.– Select the table you want to include in the

query and then click the Add button.– When all the tables you need have been

added, click the Close button.

Page 22: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Working with the Query Design Grid• The Design grid appears when you begin

setting up a new query.• This allows you to specify the fields to

include in the query.

Page 23: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Adding Fields to the Design Grid

• The first step in defining a query is to add fields to the Design grid.

• The fields you add to the Design grid will appear in the record set.

• Once you have added fields to the Design grid, you can specify sorting options, criteria and other options that affect the record set.

Page 24: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Techniques for Adding Fields to the Query Design Grid

• Double click- add a single field to the Design grid by double clicking the desired field in the field list.

• Drop down list- add a single field by clicking in a field cell, clicking the drop down button that appears and choosing the desired field from the drop down menu.

• Drag- add a field or fields by dragging them from a

field list to the desired cell in the Design grid.• All fields- add all fields to the Design grid by double

clicking the asterisk (*) symbol at the top of the desired field list.

Page 25: Introduction to Access By Mary Ann Chaney and Alicia Harkleroad

Running Queries

• You can run a query by clicking the Run button on the toolbar.

• When you run a query, Access selects records and fields from tables in your database and displays the record set.

• You can navigate through the record set or print.

• The record set always reflects the current data stored in the database.