Вы находитесь на странице: 1из 21

Part of this tutorial was adapted from a tutorial by

http://webfaculty.aub.edu.lb/~acc

Florida GolfCoast Unoversity


http://www.fgcu.edu/support/office2000/access
Bay City Schools
http://www.bcshcools.net/staff/AccessHelp.htm
Jim Fuller Tutorial
http://www.teachers.ash.org.au/jfuller/access/access2000.htm
James Madison University
http://www.jmu.edu/computing/tutorials/ microsoft/access

Access 2002 Tutorial I


1.
2.
3.
4.
5.

Ms. Access Definition


Starting Ms. Access
Creating New and Opening Existing Databases
Few Terms
Screen Layout:
a. Database Window
b. Design View
c. Datasheet View
6. Creating Tables:
a. Introduction to Tables
b. Create a Table in Designer View
c. Set Field Properties
i. Limit Field Size
ii. Set Number Format
iii. Set Date/Time Format
7. Primary Key
8. Records:
a. Adding Records
b. Editing Records
c. Deleting Records
d. Adding and Deleting Columns
e. Resizing Rows and Columns
f. Freezing Columns
g. Hiding Columns
h. Finding Data in a Table
i. Printing a Datasheet
9. Sorting and Filtering:
a. Sorting
b. Filter by Selection
c. Remove a Filter
10. Forms:
a. Create Form by using Wizard
b. Adding Records using a Form
c. Editing Forms

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

1. Ms. Access Definition:


Whether you want to organize your educational records, maintain departmental
information, or coordinate class projects, an Access 2002 database provides the
structure and flexibility you need. You can store all kinds of information in an
Access 2002 database, use queries to analyze the data, and create professional
reports with customized layout and graphics.

When you are finished with this lesson you will have a database to store
census information. In the process you will learn to:
o Use the Table Design Wizard.
o Add Fields to the Table.
o Add Data to the Table.
o Use a Form to view and add data to your table.
o Query a database for specific information.
o Customize a report on data in a database.
Your students can benefit from using a database for many classes or
school projects:
o In a science class, design a database with data you collect when
performing experiments and then create a key word search.
o In a history class, create a simple database with information about
significant individuals or events and then use reports to analyze the
information.
o In a math class, use a database to calculate statistical information.
o In a business class, create a database on the international market,
including the gross national product, import and export patterns,
and unemployment rates.
o In your school, create a database to track a school fundraiser. Use
Data Access
o Pages so all the classes at your school can add information on their
progress from the Web.
o Using the Access 2002 database, you can organize school
information. Examples of databases you can use include:
o Library resources, including books, magazines, and audio
information. When you use Data Access Pages and copy the
database to your school network, you can peruse library holdings
from the Web.
o Student information, such as name and student number, academic
records, contact information, records of disciplinary action, and
medical needs or restrictions.
o Classroom resources including curriculum objectives, text books,
supplementary texts, student learning activities, and district
standards.
o Departmental information, such as the course taught, by whom, in
which classroom, and when.

Last Updated: Friday, August 01, 2003

2 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

2. Starting Ms. Access:

Click on Start
Select Programs
Click on Microsoft Access

3. Creating New and Opening Existing Databases:

The picture, Task pane, gives you


the option to:
Open an existing database
o Open a file option
gives you the most
recent databases you
have used. If you do
not see the one you
had created, click the
More Files option.
Otherwise click the
database you had
previously used.
Create a New Database from
scratch, by clicking Blank
Database option
Or use the wizard to create a
new database, by clicking on
General Templates... option
4. Few Terms:
These words are used often in Access so you will want to become familiar with
them before using the program and this tutorial.

A database is a collection of related information.


An object is a competition in the database such as a table, query, form, or
macro.
A table is a grouping of related data organized in fields (columns) and
records (rows) on a datasheet. By using a common field in two tables, the
data can be combined. Many tables can be stored in a single database.
A field is a column on a datasheet and defines a data type for a set of
values in a table. For a mailing list table might include fields for first name,
last name, address, city, state, zip code, and telephone number.

Last Updated: Friday, August 01, 2003

3 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

A record in a row on a datasheet and is a set of values defined by fields.


In a mailing list table, each record would contain the data for one person
as specified by the intersecting fields.
Design View provides the tools for creating fields in a table.
Datasheet View allows you to update, edit, and delete in formation from a
table.

5. Screen Layout:

Database Window
The Database Window organizes all of the objects in the database. The
default tables listing provides links for creating tables and will list all of the
tables in the database when they have been added.

Design View
Design View customizes the fields in the database so that data can be
entered.

Datasheet View
The datasheet allows you to enter data into the database

Last Updated: Friday, August 01, 2003

4 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

6. Creating Tables:

Introduction to Tables
Tables are grids that store information in a database similar to the way an
Excel worksheet stores information in a workbook. Access provides three
ways to create a table for which there are icons in the Database Window.
Double-click on the icons to create a table.

Last Updated: Friday, August 01, 2003

5 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

Create table in Design view will allow you to create the fields of the
table. This is the most common way of creating a table and is
explained in detail below.
Create table using wizard will step you through the creation of a
table.
Create table by entering data will give you a blank datasheet with
unlabelled columns that looks much like an Excel worksheet. Enter
data into the cells and click the Save button. You will be prompted to
add a primary key field. After the table is saved, the empty cells of the
datasheet are trimmed. The fields are given generic names such as
Field1, Field2, etc. To rename them with more descriptive titles that
reflect the content of the fields, select Format, then click Rename
Column from the menu bar or highlight the column, right-click on it
with the mouse, and select Rename Column from the shortcut menu.

Create a Table in Design View


Design View will allow you to define the fields in the table before adding
any data to the datasheet. The window is divided into two parts: a top
pane for entering the field name, data type, and an option description of
the field, and a bottom pane for specifying field properties.

Last Updated: Friday, August 01, 2003

6 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

Field Name - This is the name of the field and should represent the contents
of the field such as "Name", "Address", "Final Grade", etc. The name can not
exceed 64 characters in length and may include spaces.
Data Type is the type of value that will be entered into the fields.
o Text: The default type, text type allows any combination of letters and
numbers up to a maximum of 255 characters per field record.
o Memo: A text type that stores up to 64,000 characters.
o Number: Any number can be stored.
o Date/Time: A date, time, or combination of both.
o Currency: Monetary values that can be set up to automatically include
a dollar sign ($) and correct decimal and comma positions.

Last Updated: Friday, August 01, 2003

7 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

o AutoNumber: When a new record is created, Access will


automatically assign a unique integer to the record in this field. From
the General options, select Increment if the numbers should be
assigned in order or random if any random number should be chosen.
Since every record in a datasheet must include at least one field that
distinguishes it from all others, this is a useful data type to use if the
existing data will not produce such values.
o Yes/No: Use this option for True/False, Yes/No, On/Off, or other
values that must be only one of two.
o OLE Object: An OLE (Object Linking and Embedding) object is a
sound, picture, or other object such as a Word document or Excel
spreadsheet that is created in another program. Use this data type to
embed an OLE object or link to the object in the database.
o Hyperlink: A hyperlink will link to an Internet or Intranet site, or
another location in the database. The data consists of up to four parts
each separated by the pound sign (#):
DisplayText#Address#SubAddress#ScreenTip. The Address is the
only required part of the string. Examples:

Internet hyperlink
example:

Academic Computing Home


Page#http://webwork.webfaculty.aub.edu.lb#

Database link
example:

#c:\My Documents\database.mdb#MyTable

Description (optional): Enter a brief description of what the contents of the


field are.
Field Properties: Select any pertinent properties for the field from the bottom
pane.

Setting Field Properties:


o Limiting Field Size:
Each field has a set of properties that control the way it stores, handles, and
displays data. Setting field properties saves time in the later stages of building
a database because they are used for forms and reports you create.
Therefore, you will have less design work to do in later stages if you set field
properties before you create forms and reports.
You normally set properties when you create a table in Design view. If you
saved the table using the default properties, you can display it in Design view
to change the property settings.

Last Updated: Friday, August 01, 2003

8 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

The field properties available in the Field Properties pane of the Design view
window depend on the data type selected in the design grid. Some of the
property types you can set are listed in the following table:

Property type

Description

Field Size

Limits a Text field to a specific number of characters or a Number


field to the range of numbers it can store.
Controls the way data appears in Datasheet view.
Displays a set number of decimal places. This property type has
no effect on Number fields using the General format and is
available for Number and Currency fields only.

Format
Decimal places

Input Mask
Caption
Default Value
Validation Rule

Validation Text
Required
Allow Zero Length

Indexed

Sets a pattern that determi nes the input format of data, such as
the hyphens in a telephone number.
Specifies a label other than the field name that appears in the
table and on forms and reports.
Displays a specified value for a field in new records.
Limits the data entered to meet a certain requirement. For
example, you can specify that the Credit Limit field cannot be
over $10,000.
Specifies the text you want to appear in an error message if the
data entered violates the validation rule.
Specifies that the field cannot be left empty when entering data
into a record.
Determines whether or not you can enter adjacent quotation
marks (" ") in a field to indicate that there is no data for that field in
the record.
Speeds up retrieval of data in a field. All primary key fields are
automatically indexed.

o Setting Number Format:


The Format property affects how data appears on the screen in Datasheet
view, not how it is stored in the table or used in calculations.
The available formats for fields with Number data types are listed in the
following table:

Last Updated: Friday, August 01, 2003

9 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

General
Currency

Fixed
Standard
Percent
Scientific

Displays a number the way it was entered. This is the default format.
Uses a comma as a thousands separator and displays a currency
symbol. Negative numbers display in parentheses. The default number
of decimal places is 2
Displays at least one digit. The default number of decimal places is 2.
The number in the field is rounded to the set number of decimal places.
Uses a comma as a thousands separator. The default number of decimal
places is 2.
Multiplies the number entered by 100 and places a percent symbol at the
end. The default number of decimal places is 2.
Expresses numbers as multiples of exponents of 10 in standard scientific
notation.

o Setting Date/Time Format:


You can change the format of a field with a Date/Time data type to change
the way the date or time appears in a table. The available formats for fields
with Date/Time data types are listed in the following table:
General Date
Long Date
Medium Date
Short Date
Long Time

Medium Time
Short Time

If the value is only a date, no time appears. If the value is only a


time, no date appears. This format is the default.
The day and month names are spelled out, such as, Tuesday, July
4, 1995.
The month name is abbreviated and the name of the day is omitted,
such as, 04-Jul-95.
The date appears as numbers separated by slashes, such as,
7/4/95.
Times appear with hours, minutes, and seconds, separated by
colons and followed by an AM or PM indicator, such as, 6:30:15
PM.
This format is the same as the Long Time format except that no
seconds appear, such as, 06:15 PM.
The time appears in the 24-hour clock format with no seconds, such
as, 18:30.

Last Updated: Friday, August 01, 2003

10 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

7. Primary Key:

One or more fields (columns) whose value or values uniquely identify each
record in a table. A primary key does not allow Null values and must always
have a unique value. A primary key is used to relate a table to foreign keys in
other tables.
Note: You do not have to define a primary key, but it's usually a good idea. If
you don't define a primary key, Microsoft Access asks you if you would like to
create one when you save the table.
To do this, simply select the field and select the primary key button

o After you do this, Save the table


8. Datasheet Records:
Adding Records
Add new records to the table in datasheet view by typing in the record beside the
asterisk (*) that marks the new record. You can also click the new record button
at the bottom of the datasheet to skip to the last empty record.

Last Updated: Friday, August 01, 2003

11 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

Editing Records
To edit records, simply place the cursor in the record that is to be edited and
make the necessary changes. Use the arrow keys to move through the record
grid. The previous, next, first, and last record buttons at the bottom of the
datasheet are helpful in maneuvering through the datasheet.
Deleting Records
Delete a record on a datasheet by placing the cursor in any field of the record
row and select Edit, then click on Delete Record from the menu bar or click
the Delete Record button on the datasheet toolbar.
Adding and Deleting Columns
Although it is best to add new fields (displayed as columns in the datasheet)
in design view because more options are available, they can also be quickly
added in datasheet view. Highlight the column that the new column should
appear to the left of by clicking its label at the top of the datasheet and select
Insert, then click Column from the menu bar.
Entire columns can be deleted by placing the cursor in the column and
selecting Edit, then click Delete Column from the menu bar.

Last Updated: Friday, August 01, 2003

12 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

Resizing Rows and Columns


The height of rows on a datasheet can be changed by dragging the gray
sizing line between row labels up and down with the mouse. By changing the
height on one row, the height of all rows in the datasheet will be changed to
the new value.
Column width can be changed in a similar way by dragging the sizing line
between columns. Double click on the line to have the column automatically
fit to the longest value of the column. Unlike rows, columns on a datasheet
can be different widths.
More exact values can be assigned by selecting Format, then click Row
Height or Format, then click Column Width from the menu bar.

Freezing Columns
Similar to freezing panes in Excel, columns on an Access table can be frozen.
This is helpful if the datasheet has many columns and relevant data would
otherwise not appear on the screen at the same time. Freeze a column by
placing the cursor in any record in the column and select Format, then click
Freeze Columns from the menu bar. Select the same option to unfreeze a
single column or select Format, then click Unfreeze All Columns.

Last Updated: Friday, August 01, 2003

13 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

Hiding Columns
Columns can also be hidden from view on the datasheet although they will
not be deleted from the database. To hide a column, place the cursor in any
record in the column or highlight multiple adjacent columns by clicking and
dragging the mouse along the column headers, and select Format, and click
Hide Columns from the menu bar.
To show columns that have been hidden, select Format, and click Unhide
Columns from the menu bar. A window displaying all of the fields in the table
will be listed with check boxes beside each field name. Check the boxes
beside all fields that should be visible on the data table and click the Close
button.

Finding Data in a Table


Data in a datasheet can be quickly located by using the Find command.

1. Open the table in datasheet view.


2. Place the cursor in any record in the field that you want to search and select
Edit, and click Find... from the menu bar.
3. Enter the value criteria in the Find What: box.
4. From the Look In: drop-down menu, define the area of the search by
selecting the entire table or just the field in the table you placed your cursor in
during step
5. Select the matching criteria from Match.

Last Updated: Friday, August 01, 2003

14 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

6. When all of the search criteria are set, click the Find Next button. If more
than one record meets the criteria, keep clicking Find Next until you reach
the correct record.

Replace
The replace function allows you to quickly replace a single occurrence of data
with a new value or to replace all occurrences in the entire table.

1. Select Edit, and click Replace from the menu bar (or click the Replace tab if
the Find window is already open).
2. Follow the steps described in the Find procedure for searching for the data
that should be replaced and type the new value of the data in the Replace
With: box.
3. Click the Find Next button to step through occurrences of the data in the
table and click the Replace button to make single replacements. Click
Replace All to change all occurrences of the data in one step.

Last Updated: Friday, August 01, 2003

15 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

Check Spelling and AutoCorrect


The spell checker can be used to flag spelling errors in text and menu fields in
a datasheet. Select Tools , and click Spelling from the menu bar to activate
the spell checker and make corrections just as you would using Word or
Excel. The AutoCorrect feature can automatically correct common spelling
errors such as two INitial CApitals, capitalizing the first letter of the first word
of a sentence, and anything you define. Select Tools, and click AutoCorrect
to set these features.

Print a Datasheet
Datasheets can be printed by clicking the Print button on the toolbar or select
File, and click Print to set more printing options.

9. Sorting and Filtering:


Sorting and filtering allow you to view records in a table in a different way either
by reordering all of the records in the table or view only those records in a table
that meets certain criteria that you specify.

Sorting
You may want to view the records in a table in a different order than they
appear such as sorting by a date or in alphabetical order, for example. Follow
these steps to execute a simple sort of records in a table based on the values
of one field:
In table view, place the cursor in the column that you want to sort by.
Select Records, click Sort, and click Sort Ascending or click Records, click
Sort, and click Sort Descending from the menu bar or click the Sort
Ascending or Sort Descending buttons on the toolbar.
To sort by more than one column (such as sorting by date and then sorting
records with the same date alphabetically), highlight the columns by clicking
and dragging the mouse over the field labels and select one of the sort
methods stated above.

Filter by Selection
This feature will filter records that contain identical data values in a given field
such as filtering out all of the records that have the value "Smith" in a name
field. To Filter by Selection, place the cursor in the field that you want to filter
the other records by and click the Filter by Selection button on the toolbar or
select Records, click Filter, and click Filter by Selection from the menu bar.
In the example below, the cursor is placed in the City field of the second
record that displays the value "Ft. Myers" so the filtered table will show only
the records where the city is Ft. Myers.

Last Updated: Friday, August 01, 2003

16 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

Remove a Filter
To view all records in a table again, click the depressed Apply Filter toggle
button o n the toolbar.

10. Forms:
Create Form by using Wizard:
To create a form using the assistance of the wizard, follow these steps:
1. Click the Create form by using wizard option on the database window.

2. From the Tables/Queries drop-down menu, select the table or query


whose datasheet the form will modify. Then, select the fields that will be
included on the form by highlighting each one the Available Fields
window and clicking the single right arrow button > to move the field to the
Selected Fields window. To move all of the fields to Select Fields, click
the double right arrow button >>. If you make a mistake and would like to
remove a field or all of the fields from the Selected Fields window, click the
left arrow < or left double arrow << buttons. After the proper fields have
been selected, click the Next button to move on to the next screen.

Last Updated: Friday, August 01, 2003

17 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

3. On the second screen, select the layout of the form.


o Columnar - A single record is displayed at one time with labels and
form fields listed side-by-side in columns
o Justified - A single record is displayed with labels and form fields
are listed across the screen
o Tabular - Multiple records are listed on the page at a time with
fields in columns and records in rows
o Datasheet - Multiple records are displayed in Datasheet View
Click the Next button to move on to the next screen.

Last Updated: Friday, August 01, 2003

18 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

4. Select a visual style for the form from the next set of options and click
Next.

5. On the final screen, name the form in the space provided. Select Open
the form to view or enter information to open the form in Form View or
Modify the form's design to open it in Design View. Click Finish to
create the form.

Last Updated: Friday, August 01, 2003

19 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

Adding Records using a Form:

Input data into the table by filling out the fields of the form. Press the Tab key to
move from field to field and create a new record by clicking Tab after the last field
of the last record. A new record can also be created at any time by clicking the
New Record button at the bottom of the form window. Records are automatically
saved as they are entered so no additional manual saving needs to be executed.

Editing Forms

The follow points may be helpful when modifying forms in Design View.
o Grid lines - By default, a series of lines and dots underlay the form in
Design View so form elements can be easily aligned. To toggle this
feature on and off select View, and click Grid from the menu bar.
o Snap to Grid - Select Format, and click Snap to Grid to align form
objects with the grid to allow easy alignment of form objects or uncheck
this feature to allow objects to float freely between the grid lines and dots.
o Resizing Objects - Form objects can be resized by clicking and dragging
the handles on the edges and corners of the element with the mouse.
o Change form object type - To easily change the type of form object
without having to create a new one, right click on the object with the
mouse and select Change To and select an available object type from the
list.
o Label/object alignment - Each form object and its corresponding label
are bounded and will move together when either one is moved with the
mouse. However, to change the position of the object and label in relation
to each other (to move the label closer to a text box, for example), click
and drag the large handle at the top, left corner of the object or label.

Last Updated: Friday, August 01, 2003

20 of 21

Academic Computing Center - AUB

Access 2002 - Tutorial I

http://webfaculty.aub.edu.lb/~acc

o Tab order - Alter the tab order of the objects on the form by selecting
View, and click Tab Order from the menu bar. Click the gray box before
the row you would like to change in the tab order, drag it to a new location,
and release the mouse button.

o Form Appearance - Change the background color of the form by clicking


the Fill/Back Color button on the formatting toolbar and click one of the
color swatches on the palette. Change the color of individual form objects
by highlighting one and selecting a color from the Font/Fore Color palette
on the formatting toolbar. The font and size, font effect, font alignment,
border around each object, the border width, and a special effect can also
be modified using the formatting toolbar:

o Page Header and Footer - Headers and footers added to a form will only
appear when it is printed. Access these sections by selecting View|Page
Header/Footer on the menu bar. Page numbers can also be added to
these sections by selecting Insert, and click Page Numbers. A date and
time can be added from Insert, and click Date and Time. Select View,
and click Page Header then Footer again to hide these sections from
view in Design View.

Last Updated: Friday, August 01, 2003

21 of 21

Вам также может понравиться