MS Access 2007 Tutorial
MS Access 2007 Tutorial
A blank database is a database with nothing in it. You must create all the tables,
forms, reports, queries, and so on. If you cannot find a template that suits your
needs, create a blank database. After you create the database, Access opens to a
datasheet and makes available the tools you need to create objects. Creating
tables is the first step in building a database. You will learn more about creating
tables in the next lesson.
1. Start Access.
2. Click Blank Database.
3. Type the name you want to give your database in the File Name field.
Access will automatically append .accdb to the name.
4. Click the Browse button. The File New Database window appears.
5. Locate the folder in which you want to store your database. Note that the
name of the file appears in the File Name field.
6. Click OK.
7. Click the Create button. Access creates the database and opens a
datasheet with the Table Tools available to you.
Creating a Table
When you click the Create button your Access 2007 screen will change to the
image below. This is the “new look” in 2007 Office. You will now see Tabs and
Ribbons that automatically appear for the area in Access on which you’re working.
Instead of a Menu Bar and drop down selections, you’ll now see these new
features. Tabs
Ribbo
n
Group
s within
When we clicked the Create button Access assumed we desired to create –
our Person database – another database – which is called a Table. You’ll notice
that at the top of the above image that the Table Tools and Datasheet Tabs
appeared to assist you. The Ribbon below these Tabs is composed of Groups of
selections you’ll use to assist you as you create your Table. We’ll be working with
these Tabs/Ribbons throughout this tutorial.
In the lower portion of the above image you’ll see selections that indicate we are
creating a new Table.
On the left of the Table Tools-Datasheet Tab/Ribbon you’ll see a View button.
Click the View button.
When you click the View button the image on the left
will appear. Since we want to create or design a new
Table, we’ll click the Design View selection.
Your Access 2007 screen will now change again – to the image below.
We’ve enlarged the upper left corner of this image below.
Notice (in the image above) that our Table Tools Tab still appears. However,
because we are now in the Design process, the lower Tab/Ribbon has changed to
Design – to assist us with designing our Table.
To “turn off” the Primary Key, click the Primary Key button. You’ll notice that they
Primary Key button is no longer “orange” and the little key is gone from the left of
ID.
If the Personnel Table image does not “fill” the screen, click-on
the small square between the “minus and the X” in the upper right
hand corner of the screen (see arrow and image on right). This will Maximize the
screen.
Notice, under the Blue Bar at the top of the Design screen there are (3) things:
Field name, Data Type, and Description
We’ll be creating the Field Names that make up a database. This is similar to
creating a blank personnel form (on paper) that will be "filled-in" for each employee
(Name, Address, Phone Number, etc.). The areas that will be filled in are called
Fields in a database. When you fill in all of the fields for a person, the individual
"forms" are called records in a database. There will be a record, or form, for each
employee. All the forms, together, make up a Table (database).
Data Type
Text You may type in any alphabetical/numerical data that you desire -
up to a maximum of 255 characters. As indicated, this is a text field, so you can't
do mathematical calculations. Examples of Text data are: names, addresses,
stock numbers, room numbers, zip codes, etc.
Memo This field is for lots of text. You can have up to 32,000 characters.
Number This field is for numbers where you want to add, subtract, multiply, divide,
average, and do numerical calculations. This field can be a very large size, so
when we get to Field Properties, we'll talk about "sizing" this field so it doesn't take
up to much "space" in storage.
Date/Time Dates and Times. You may format these later, as you may desire.
Currency Dollars ($). You may format these later, as you may desire.
OLE Object This means "Object Link Embedding" which indicates you can
insert a graphic, picture, sound, etc. Pretty neat to put a photograph in a personnel
record or a picture of an inventory item in the stock record (advanced stuff).
Since this is a simple, introductory Access tutorial, we won’t work with Hyperlinks,
Attachments, or Lookup Wizards.
We'll leave Last Name as a Text Data Type. To the right under Description you
may make any remarks you feel are appropriate to someone who may want to
know how/why you designed the field as you did.
Now notice in the lower part of the screen, under Field Properties, that a box
appeared when you selected the Text Data Type. This box is "tailored" to the Text
Data Type that you selected above. Your Field Properties should look like the one
below when you finish doing the steps indicated below.
To create relationships:
1. Close all tables and forms. (Right-click on the tab of any Object. A menu
appears. Click Close All.)
2. Activate the Database Tools tab.
3. Click the Relationships button in the Show/Hide group. The Relationships
window appears.
12. Click the Save button on the Quick Access toolbar to save the
relationship.
Tip: After a relationship has been created between two tables, you must
delete the relationship before you can make modifications to the fields on which
the relationship is based. To delete a relationship:
Create Form
In the previous lesson, you created an Access Table and entered three records.
However, to get the most out of Access it makes sense to create a data entry
FORM. By doing so you are making your database more user friendly. It is easier
and quicker to enter data onto a form than it is into a table, not least because you
have more control over the layout and labelling of your form. In this lesson we will
learn how to create a FORM that uses your newly created table as the DATA
SOURCE.
There are a number of ways to create an Access form. In this lesson we are going
to use the ACCESS FORM WIZARD.
Open your database if it is not already open. Click the CREATE tab on the
ACCESS RIBBON and then select MORE FORMS from the forms group.
A drop down list of form types appears. You need to select FORM WIZARD from
this list.
Underneath there is a list of the four fields in your table. You could select each field
individually by highlighting the field name and clicking the single arrow >. We can,
however, select all four just by clicking the double arrow >>. Once they have been
transfered into the right hand box they are selected. We can now click NEXT to go
to page 2 of the form wizard.
3. Form Layout
This is where we choose the FORM LAYOUT. We are going to leave this on the
default setting of COLUMNAR. Click NEXT again to move onto page three of the
form wizard.
4. Form Style
Here we select a style that from the list box. Preview a style by clicking on its
name. This step just determines how the form looks aesthetically. Once you have
selected a style to your taste, click NEXT again.
5. Form Title
This is the last stage of the wizard. Here we are going to choose the name for our
form - lets say FORM1. We are going to leave the radio button selected for OPEN
THE FORM TO ENTER OR VIEW INFORMATION
All we need to do now is click FINISH and our form should like something like this:
As you can see, the form opens with the first record in your original table
displayed. You can navigate through each record using the NAVIGATION
BUTTON at the bottom left of the form window.
To move to the next record click the right arrow button on the navigation control.
To move to the last record click the >| button on the navigation control. To move
backwards through the recordset use the left arrow buttons. You could edit any
record from the form, which will update the data in your table. For now, though, just
try navigating through the three records without changing any data.
Now that you know how to move through the recordset, lets finish off by adding two
more records. To do this click the star button on the right of the navigation control.
This should bring up a blank record. Add JOE for firstname, BROWN for surname,
and 39 for age. Click the star again to bring up a new blank record, and enter SUE
MOORE 33. When you have finished click x on the form window to close.