Access 2007 Basics

Embed Size (px)

Citation preview

  • 8/9/2019 Access 2007 Basics

    1/27

    230 Combs Building 622-3050 http://support.resnet.eku.edu [email protected]

    Introduction

    Access 2007 was released by Microsoft December 6, 2006. Access

    was designed for the main purpose of allowing users to create their own

    personal databases. The table system appears similar to Excels, but it is

    extremely different because it can store a wide range of values, dates,

    and address information. Furthermore, Access can be used with other

    Office programs, such as Word. A user can take their database created

    in Access that lists, for example, their co-workers addresses and then

    import this database to Word to write a letter to all their co-workers

    using the items in this database.

    Purpose

    This manual is provided to offer users a basic understanding of the

    functionality of Access 2007. It offers a step by step guide to teachusers how to make a database for personal use and provide a basic

    understanding of the tools used in Access. This manual will explain the

    steps necessary to create tables, fields, relationships and queries. Topics

    covered in this manual will include:

    Creating a Blank Database Creating Fields and Editing Field Properties Creating Relationships Between Tables Creating Queries, Forms, and Reports

    A

    Basic

    Introduction

    to

    Access

    2007

  • 8/9/2019 Access 2007 Basics

    2/27

    6/20/2010

    2

    Opening Access

    Once Access has started it will prompt you if you want to create a blank database

    or a template. This manual will cover creating a blank database, so you would want to

    click the blank database icon in the upper left hand corner of the screen. Then, Access

    will ask you what you want to name your file and where to save the file in the right handcolumn; the default name is Database1.

    To change the location of where to save the file, click on the folder icon to the

    right of the file name and the window below will ask you where to save the file, then

    select okay. When you are done, click the create button to begin the process of making

    your database. After this step Access will automatically save your database to this file

    or you will receive a message asking you to save the database.

  • 8/9/2019 Access 2007 Basics

    3/27

    6/20/2010

    3

    Once you have selected Create, a blank database will pop up with rows and

    columns for you to enter in data. The three main items on this page are the main

    toolbar, the All Tables column that lists the tables in your database, and the fields listed

    in the table you have open. Access opens a default table called Table1; a database in

    Access is comprised of multiple tables of information. Table1 is in Datasheet View

    when it allows the user to enter the data in rows, like below.

  • 8/9/2019 Access 2007 Basics

    4/27

    6/20/2010

    4

    Creating Fields and Editing Field Properties

    A user could go ahead and begin entering in their data,

    but that is not recommended. If you already know the specific

    fields you want in your table, then it is best to change the table

    to design view and enter the field names and properties. Toenter the Design View click the View tab in the top left hand

    corner. There are four views available, but this guide will only

    focus on Datasheet View and Design View. Click on Design

    View and Access will prompt you to save your table and the

    default name will be table1; enter in the name for your table

    and click okay.

    You should enter Design View and you are shown three columns: Field Name, Data

    Type, and Description. Field Name is the name that will display in each column in yourdatabase, like SSN, Age, etc. Data Type tells Access what to store the variable as, such

    as text, number, or date. Description is for the user to keep track of what the variable

    is used for in the database.

  • 8/9/2019 Access 2007 Basics

    5/27

    6/20/2010

    5

    Access will always have one field preset as ID, you can keep this field as it is or

    change it. The user can now go ahead and enter the specific names for the fields. An

    example table about employees is shown below to explain how to create fields in Design

    View. In the example the employees have nine fields. You may notice that the ID field

    has a little key icon to the left of it. This means that this field is designated as the

    primary key. The primary key is the unique identifier for items in this table and primarykeys must be different from one another. A user can select two keys to act as a primary

    key. All tables must have at least one primary key.

    For each field there are eleven different data types. You want to change the Data

    Type based off what type of data you are going to store in that field. Most Data Types

    are self explanatory. For example, the field Wage needs to be stored as currency

    because it is the money an employee makes per hour. More than likely, Text will be the

    data type that is used most often.

    Clicking on each field displays options on the bottom of the screen for how the

    field will be displayed. Based on the Data Type, the options differ for displaying the

    information in the field. The main options you might want to consider editing will be

    discussed. Field Size controls the maximum number of symbols shown in the field. The

    Required option determines whether or not all data must contain this field; a social

    security number field could be a field that someone might want to set to be required.

    Also, Default Value is the value entered into the database automatically if you do not

  • 8/9/2019 Access 2007 Basics

    6/27

    6/20/2010

    6

    enter your own. As an example, the text field, State, is shown below and the field size

    is set to two, so that the user can only enter two letters as the state initials.

    The text field offers the ability to change the input mask. If you click on thebutton with the three dots you bring up the Input Mask Wizard to alter how the data is

    displayed.

    First off, the wizard asks you how you want your data to look and you get quite a

    variety of choices. You can search through the list to find the format that best suits

    your field and click next. Since the field in the example that is being shown is for the

    Zip field, then the Input Mask selected is Zip Code.

  • 8/9/2019 Access 2007 Basics

    7/27

    6/20/2010

    7

    The next window prompts the user to see if they want to alter the Input Mask. If

    you dont want to make any changes go ahead and click finish.

    The Format option is also very useful when using numerical values. The Format

    option gives you the ability to change units or currencies, as shown in the window

    below.

  • 8/9/2019 Access 2007 Basics

    8/27

    6/20/2010

    8

    Once the fields are entered correctly you can enter data into the table by going

    back to Datasheet View by going through the View tab at the lop left hand corner and

    selecting it. To enter data into the table just type it in like you would do in Excel. Based

    on what options you set in each field it may alter how you can enter your data. Forexample, when entering the state initials into the state field you cant enter a text string

    longer than two letters because the field size was set to two.

    The following is an example of entries for the table Employees.

    In addition, under the Datasheet tab you have the options to edit/add/delete fields

    and alter how data is displayed without going to Design View.

  • 8/9/2019 Access 2007 Basics

    9/27

    6/20/2010

    9

    A user can also choose to create a new table by

    clicking the table button under the Create tab in the

    toolbar. It should automatically create a table that is

    named table1, which you can rename or delete yourself

    by right clicking on it in the All Tables column.

    Another example table was created called Projects to help display how to create

    relationships and run queries in Access.

  • 8/9/2019 Access 2007 Basics

    10/27

    6/20/2010

    10

    Creating Relationships

    You can create relationships between tables

    by clicking the Relationships button under the

    Datasheet tab, which is the right most tab on thetoolbar. Relationships allow tables to exchange

    data between each other.

    If you are not automatically prompted to select which tables to display you should

    click the show table button under the Design tab on the toolbar. In the example I have

    two tables: Employees and Projects. Left click each table you want to display in the

    relationship screen.

  • 8/9/2019 Access 2007 Basics

    11/27

    6/20/2010

    11

    After selecting which tables to display in the Relationship screen you will see your

    tables displayed with the fields listed inside of them.

    To create a relationship left click on a field that has a field with the same value inthe other table and drag it over to the table you want to create a relationship with. For

    example, the field Last Name was dragged over to Worker Last Name to create a

    relationship between Employees and Projects. Then, you will be prompted with the

    following box.

    Clicking the create button should

    create a black line connecting the two

    tables representing a relationship. The

    other options shown wont be covered in

    this manual.

  • 8/9/2019 Access 2007 Basics

    12/27

    6/20/2010

    12

    A user can create multiple relationships between tables. If a user tries to create a

    second relationship by dragging another field over to the other table, then they are

    prompted with this message.

    By clicking yes you are allowed to add a second relationship between the two

    tables, but it technically says you are editing the previous relationship. In the example

    a second relationship can be made between First Name and Worker First Name. To

    create this second relationship you have to scroll through the fields in each table and

    select First Name and Worker First name, then click create.

    Adding this relationship will add a second black line between the two tables shown.Users can create many relationships. One table can have more than one relationship

    with multiple tables as long as the other table as the same type of field in it.

    Relationships enable multiple tables to exchange their data, so that advanced

    correlations can be made and to ensure data is correctly entered.

  • 8/9/2019 Access 2007 Basics

    13/27

    6/20/2010

    13

    Creating Queries, Reports, and Forms

    Creating a query allows the user to select certain amount of data with a specific

    set of properties without having to look throughout the whole database. Creating a

    Report allows a user to create a printable document with a specific set of data on it, and

    reports can be made for queries or tables. Also, a Form will display all the data in atable through a multiple page document that the user can flip through. The buttons to

    create queries, forms, and reports are located under the Create tab.

    To create a query you want to click Query Design. The screen below should pop

    up. However, Query Wizard doesnt offer the same abilities to customize your query.

  • 8/9/2019 Access 2007 Basics

    14/27

    6/20/2010

    14

    The query design view allows users to show their tables. This specifies what

    tables will be in the query. Also, it acts as a reminder as to what fields and relationships

    each table contains. The table at the bottom of the screen is where you will be able to

    select which fields you want to include in the query. Users will be able to specify the

    criteria for the query. The main commands you will want to use in the toolbar below arethe Run, Delete, and Totals commands.

    In order to start making a query go

    ahead and select the arrow button on the row

    that says Field. It will list all the fields inevery table you have selected to run in the

    query. In the example to the right, the tables

    Employees and Projects are being used.

    In our example query the fields ID, Last

    Name, First Name, and Project Name are

    listed. The Table row tells the user what table

    the field is from. The other rows are helpful

    as well. The row Sort can display the field inascending or descending order. Checking the box in the Show row determines whether

    or not the to show the row when the query is finished and Criteria specifies what

    information you want the query to find.

  • 8/9/2019 Access 2007 Basics

    15/27

    6/20/2010

    15

    Below is an example of how to use the Criteria row. Under Project Name we want

    the query to find all Projects with the name Project Dolphin. It is okay to use phrase

    =Project Dolphin too. The query should display the employees names who are part of

    Project Dolphin. Once you are done entering in criteria you can hit the Run bottom at

    the top left hand corner of the screen.

    As you can see, Access created a query called Query1 with the information we

    wanted. You can rename your query or delete it.

    When the user clicks to do something else, Access will prompt the user to save the

    query, which allows you to rename it.

  • 8/9/2019 Access 2007 Basics

    16/27

    6/20/2010

    16

    To add criteria to another field will act as an AND. For example, if a user wanted

    to search everyone who worked in Project Dolphin and with the last name Smith, then

    the user would add the word Smith to the criteria box under the Last Name column.

    Also, you can use the OR row to run queries to find all the employees in Project Tiger or

    Project Panda as shown in the examples below.

  • 8/9/2019 Access 2007 Basics

    17/27

    6/20/2010

    17

    As you write queries you may have noticed that you can

    switch between datasheet view and design view just like when

    making a table. However, you are offered another view, which

    is called SQL View. This view shows the query in its SQL form

    or Structured Query Language. SQL is a language foraccessing information from databases, but it will not be

    covered in this manual.

    Access also allows users to do mathematical

    calculations, just like in Excel. If the user clicks the Totals

    button under the Datasheet tab in the right hand corner of the

    toolbar, then the Total row will be displayed at the bottom of

    the screen. In the example below the user can display the

    sum of weekly hours for each member of each project.

    After running the example query, the query should pop up below, with the Hours

    column automatically changed to SumofHours.

    There are multiple symbols that can be used when specifying criteria for queries in

    Access. User can use , = to specific a range of values. Also, you can put

  • 8/9/2019 Access 2007 Basics

    18/27

    6/20/2010

    18

    an asterisk after or before a letter or number, such as p or 1, to retrieve all the words

    that start or end with p or all the numbers that start or end with 1. If a user puts

    asterisks on both side of a letter, then any word with that letter at all is retrieved. The

    question mark symbol will act as filler for any other symbol. For example, f?nd would

    find the words find, fend, fond, etc. Another important symbol is , which acts as the

    the not equal sign, which is shown below. There are many symbols and reserved wordsthat Access uses to refine queries, so it is impossible to explain all of them.

    Creating a Report

    For creating a Report a user needs to first open the table or query they want the

    report to retrieve its information from. Then, you need to click the Report button under

    the Create Tab.

    This will simply take all the information in the table and display it in a printabledocument. Just like for the Employees report on the next page.

  • 8/9/2019 Access 2007 Basics

    19/27

    6/20/2010

    19

    A user can customize this report by clicking the view

    button and going to Layout View or Design View. A user can

    alter columns and rows, add text, or take averages and sums.

    Using Report Wizard allows the user to avoid making these

    changes after the report is made. Click the Report Wizard

    button under the Create tab to run this program.

    A window will pop up prompting the user to select what

    table or query to run the report for and to select what

    information the report will display from that table or query. In

    the example below, the table Employees has been selected.

    The user selects or removes which fields to display in the

    report by clicking the left and right arrows between the boxes

    labeled Available Fields and Selected Fields.

  • 8/9/2019 Access 2007 Basics

    20/27

    6/20/2010

    20

    After clicking next the user will be able to select what field to group the

    information by and the priority of the groups by using the arrow buttons. You do not

    have to group the information. If you feel like customizing how your data is grouped

    then click the Grouping Options in the bottom left corner, otherwise click next.

    More advanced options are shown and they give the user the ability to alter the

    order in which fields are display.

  • 8/9/2019 Access 2007 Basics

    21/27

    6/20/2010

    21

    Summary options are important for making mathematical calculations. In the

    example below the only two fields listed are the fields using the number data type.

    When you are finished with your settings click okay and it will return you to the previous

    window and when you are done selecting the sort order options click next.

    These next options specify the layout of the report. When you are done click next.

  • 8/9/2019 Access 2007 Basics

    22/27

    6/20/2010

    22

    Access offers a lot of preset styles for your report to be presented as and you can

    preview how the report will look in the box to the left. The default style is Office and

    once the user has selected the style they prefer click next.

    This last window offers the ability to title the report, preview the report, or makesome last minute design changes. If you feel comfortable with your report click finish.

  • 8/9/2019 Access 2007 Basics

    23/27

    6/20/2010

    23

    Now the user is shown their report; if you do not like how the report is designed or

    you cant read some of the information in the fields then going to the Design View under

    the View button under the Home tab on the toolbar should allow you to edit text and

    alter the size of your columns so that all the text can be read in the report.

    This is the report above shown in Design View.

  • 8/9/2019 Access 2007 Basics

    24/27

    6/20/2010

    24

    One change that was made was changing the text

    Summary for City to Total Hours Per Week for, because

    it is easier to understand.

    Now changing the window back to Layout View under the View button will showthe changes you have made. Print View will allow you to print the Report.

    Creating Forms

    Creating forms are quite simple and this manual will not go into detail about

    splitting forms or designing forms. In order to create a form from a table or query you

    have in your database you need to left click on it from the list in the All Tables column.

    Next, click the Form button under the Create tab on the toolbar, just like in the toolbar

    below.

  • 8/9/2019 Access 2007 Basics

    25/27

    6/20/2010

    25

    A form should pop up that displays all the entries in the database, but on separate

    pages that the user can flip through using the arrows at the bottom left hand corner of

    the screen.

    With these forms, the user can now print off the information as needed or save the

    form to the database.

    Closing Access

    To close Access click the Office button in the top left hand corner of the screen and

    scroll down through you options to the bottom and click Close Database.

  • 8/9/2019 Access 2007 Basics

    26/27

    6/20/2010

    26

  • 8/9/2019 Access 2007 Basics

    27/27

    6/20/2010

    27