Professional Documents
Culture Documents
Before you can begin to use a database, you need to become familiar with the Access
window.
The Ribbon
Like other software in the Microsoft Office 2007 suite, Access 2007 has a tabbed Ribbon
system you use to navigate the database. The Ribbon is organized into tabs. Each tab
contains groups of commands you use to perform tasks in Access.
For example, on the Home tab you'll see that there is a Font group that contains font
formatting commands such as font type, size, color, and alignment. Unless you use
keyboard shortcuts for everything, the Ribbon is how you get work done in Access.
The Quick Access Toolbar
Once you are familiar with Access, you may find that there are commands you use more
often than others. To make it easier to use these commands, you can add them to
the Quick Access Toolbar. By default, the toolbar appears above the Ribbon on the left
side of the Access window and includes the Save, Undo, and Redo commands.
The Microsoft Office button
The Microsoft Office button is located in the upper-left corner of the Access window
and includes key menu options such as New, Save, and Print. From this menu, you
can also change your Access Options.
The navigation pane
The main control center of each Access database is the navigation pane. It shows you
what is in the database and makes the information accessible to you. You can choose to
close the navigation pane if you need more of the Access window to complete specific
tasks.
To open and close the navigation pane:
Click the Shutter Bar button on the right side of the navigation pane.
If you are new to databases, arranging the objects by type in the navigation pane is
usually a good idea. This will group tables, forms, queries, and reports into individual
groups in the pane.
Tables
Queries
Forms
Reports
We'll look at each of these objects in more detail in later lessons, but you can access
them from the navigation pane like you can with tables.
Tables
A table is the database object that contains the basic information you want to store. A
blue and white icon represents the table in the navigation pane.
Forms
A third database object is the form. Forms are an Access tool you can create to
make data entry in database tables easier.
Entering data directly into a table can be difficult if there's a lot of information to enter.
Similar to an Excel spreadsheet, an Access table is essentially a screen filled with blank
rows where you enter records. Forms, however, give you an easy-to-read interface
where you can enter table data. Forms are especially useful for Access users who aren't
comfortable working with databases.
Reports
The final database object is the report. A report is an effective way to analyze and
present data using a specific layout. The text can be formatted in an Access report, just
like it can be in Word documents.
To close an object:
Select the tab for the object you want to close. (The highlighted tab is the active tab).
Right-click the tab, and select Close from the menu.
Thinking about Database Design
Introduction
The first step in creating a database is to think about why you need it—what is
its purpose? Once you know the answer, you can begin designing your own database.
Ask yourself questions like What kinds of information will it store? How will I have to
break down this information so it can be stored in my database? How will I use the
data once it's in there?
In this lesson, we'll walk you through the steps of database design using a bookstore
scenario. You will determine the purpose of the database and plan the tables and
fields you will need for a simple bookstore database.
The best way to learn about designing a database is to jump right in to the process.
Let's pretend we work for the Ready-2-Read bookstore, and we need to build a
database for the store to use. Let's think about what we might need the database to
do for us.
The following diagram shows that we have customers and sell books via orders, both
in the store and online.
The store needs a way to keep track of these things.
Once we've established its purpose, we can begin brainstorming about how to break
up the information into the tables the database will need to store data. Recall that
a table is a collection of records, and each record is broken up into the smallest pieces
of needed information, called fields.
Because we're planning a database to track our customers, the books we have, and
the orders our customers place, we will need a table for each one of these.
TIP: Keep your database usable to others by giving your tables simple, easy-to-
understand names.
Plan table fields
Once you know what tables you need, the next step is deciding what fields belong in
each table. Remember that fields are the smallest chunk of information in any record.
Let's look at our Ready-2-Read bookstore example again. There will be several fields in
our Customers table. We'll obviously want each customer's first name and last name.
We'll also need an address if we need to send a customer his order. Email will be
necessary if we need to contact the customer if there is an issue with the order.
We will also need several fields in the Books table. Title and Author make sense for
books. We'll need a Price for each book. Category will help us know what type of books
sell the best so we can order more books that fit into this category.
The Orders table will have fewer fields. We'll need this table to track the Customer who
is placing the order, the Book the customer is ordering, and the Date the order is
placed.
Don't worry if your plan doesn't include every possible field you may need. Access lets
you add fields to tables whenever you need another one!
Setting up Tables and Fields
Now that we have a handle on what the database should look like, we need to work
on setting up our tables and the fields within these tables.
In this lesson, we'll walk you through the steps of setting up a database in Access
2007. You'll be setting up tables according to the plan for our bookstore scenario.
You'll also be setting up the fields for each table, including establishing what data
types can be entered in a given field.
When you launch Access 2007, you will see the Getting Started window.
You will also see the New Blank Database option, which allows you to build your own
database from scratch.
When you choose the New Blank Database option at the top of the window, you will be
prompted to rename the database from the default name, which is Database1.accdb.
Rename the database whatever you want. In the example below, we named the
database Ready2Read because it's the name of the store in our scenario.
Naming a table
To give the table a unique name, you must first click on the Microsoft Office button in
the upper-left corner of the application.
The new table names appear in both the navigation pane and the Table tab itself, as
you can see in the picture below.
The table name will be highlighted and a cursor will appear, which means you can
now type the new name right there. Left-click anywhere outside of the table name
to make the change.
To close a table:
By default, Access 2007 starts out with one table. To add more tables to the database,
click the Create tab on the Ribbon.
Next, select Table from the Tables command group. A new table will open in the
active database object window. You must name your table using the Save command
from Microsoft Office menu.
TIP: You can tell which table you are currently in by seeing which table tab is
highlighted.
Adding fields to a table
Access 2007 allows you to add fields to tables when you are:
To switch views:
By default, Access 2007 creates one field in each new table: the ID field. This field auto-
numbers to give each record in the table a unique number identifier. Recall that records
are the rows in a table.
TIP: You may want to rename the ID field with a unique name because the ID field
appears automatically in every table you create. While this is not necessary, it may help
avoid confusion when setting up table relationships.
To add more fields to a table in Datasheet view, double-click the Add New Field header.
The Add New Field text will disappear from the header. Name the field by typing the
name directly into the header. Press the Tab key on your keyboard to move to the next
field.
In Design view, the field names are along the left hand column instead of across the top
like in Datasheet view, as seen below.
To add a new field to a table in Design view, click in the cell where you want the new
field and type the field name. When you switch back to Datasheet view, your new field
appears as its own column, as seen below.
In Design view, you have several field property options you can set to ensure data can
only be entered in certain formats. Setting these options is a good idea if you want to
make sure the data you have in your database is good, strong data.
Moving fields
If you want to rearrange the order in which your fields appear in a table, Access 2007
lets you easily move them around. To move a field in Datasheet view, drag and drop the
field to the location you want. To do this:
Deleting fields
WARNING: You should not delete any field in a table without first knowing what
impact the deletion may have on the rest of the database!
Setting the data type for a field
Access 2007 lets you control how data can be entered in each table field within your
database. This is done using Data Type. The default data type is text for every field
after the ID field, which was set to auto-number. You can change the Data
Type setting in two ways:
Click the field header, then select the data type you want from the drop-down menu
next to the Date Type command.
To change data type in Design view:
Click the field name, then press the Tab key on your keyboard. From the drop-down
menu under the Data Type column, select the format you want.
The data type is more noticeable when the database is being populated with records. It
will cause data to be formatted for currency, text, number, and date and time just like it
does in Microsoft Excel.