Access
Access
What is a Database
A Database is a collection of related data.
For example, a phone book is a database of
names, addresses and phone numbers.
Starting Microsoft Access
Type the
name
4. Type the name of the database in the File Name
box. Click Create button.
The components of the Access
and Database windows
Database Window
Database Window
1. The Title bar: shows the name and file format of the
database.
2. The Database Window Toolbar: Use the Open button
to work with objects, or use the New button to create
new objects.
3. Object Toolbar: Click one of the object types, such as
Tables or Forms.
4. Use New Objects Shortcuts list to create new database
objects.
5. The list of database objects changes according to
which object type you have clicked under objects.
Objects
Access database includes such objects as:
1. Tables: Are collections of similar data.
2. Queries: Are requests to access information.
3. Forms: Are on the screen arrangements that make it easy
to enter and read data.
4. Reports: Are paper copies of queries.
5. Pages
6. Macros: Are tools that can help automate complex or time-
consuming repetitive manual tasks.
7. Modules: Are programs that advanced users creating with
access basic a programming language.
Creating New Table
Designing database from scratch requires considerable
attention to details. You need to decide which
information to collect; what names to give each field,
specify the types of field you will be using.
…Cont
Button:
1. New Create New Object
2. Open Open Object
3. Design View the content and
properties of object
To create new table:
1. Choose the object Tables.
2. Click New.
View of a Table
2
Table Design View
Click on the object Table from Database
window then click on Design button.
Table Design View
Then the table design will appear as in this figure.
Filed type comments
Column
name
Column
properties
Table Design View
1. Field Name click on the first empty field
name box and type a unique name.
2. Data Type and Properties : access offer
eight data types for its field.
3. Description
4. Every field in a table has a set of a
Properties : A field property is a specific
characteristic of a field .
Data Type
1. Text: Alphanumeric data; including letters,
numbers; spaces and punctuation symbol
Saving a Table:
Choose Save form File menu. Or click on Save
Naming of the Tables
Opening a Table:
1. Click Tables object in Database window.
2. Double click the table you want to open.
3. To open the table in the design view, click
the table and then, click Design on the
Database window toolbar.
Add New Field to your Table
1. Open the table in Design View.
2. To insert the field within the table, click in the
row below where you want to add the field,
and then click Insert Row on the toolbar.
3. Click in the Field Name column and type a
unique name for the field.
4. Select the data type you want.
Deleting Row
1. Select field you want to delete by clicking that
field’s row selector.
2. Click Delete Row on the toolbar.
Entering Data
You can enter and edit text directly in tables in
Database view.
Tab to the first field into which you want to enter
something. When you get to desired field, start
typing. Press TAP or Enter to move to the next
field of interest.
Changing the default direction of database
objects
To change the default direction of database objects:
1. On the Tools menu, click Option, and then click
the international tab.
2. In the Default Direction option group click:
• Click Left-To-Right to have new objects
displayed in a left to right direction.
• Click Right-To-Left to have new objects
displayed in a right to left
Step 1 Step 2
Changing Individual Table Directions
1. Open a table in Datasheet View.
2. Click anywhere in the text field.
3. On the Format menu, click Datasheet.
4. In the Direction option box, select the direction you
want.
Setting Field Properties
Access offers eight data types for its fields, and each
type offers a variety of options called Properties.
Purpose Property
The maximum length of a text or numeric Field Size
field.
allows you to specify how numbers, dates, Format
times and text are displayed and printed.
• If you drag a field that is not a primary key and does not
have a unique index to another field that is not primary
key and does not have a unique index, an Indeterminate
relationship is created.
Editing an Existing Relationship
To delete a relationship :
1. Click relationship from the toolbar, if the tables
whose relationship you want to delete are not
displayed, click Show Relationship.
2. Click the relationship line for the relationship
you want to delete, and then press Delete Key
To Edit a relationship:
Double click the relationship line for the
relationship you want to edit, set the
relationship options.
Viewing the Existing Relationships
To View the existing relationships:
1. Switch to the Database window.
2. To view all the relationship defined in the
database, click Show All Relationship from the
toolbar.
Show Table
Add
Button
Design
Grid
Query Design Window
Data
quiry
filed
table
Query Design Window
Parts of query design window:
The top portion displays the table on which you
have chosen to base your query.
The bottom portion of the window contains the
rows on the grid are used to refine your queries
and are described bellow:
Fields: show the fields you want to add to your
query.
Table: used to clarify which table the field
belongs to when dealing with a multiple-table
query.
Sort: used to sort out the resulting table into
ascending or descending order by the field in
this column.
Show: used to specify whether the field should
be displayed in the resulting table.
Criteria: used to set criteria for selecting
records to be displayed in the resulting table.
Or: used it to specify another criterion.
Views of a Query
• Click the View button on the toolbar.
• To display the Datasheet click.
Table
Field
You
choose
Table
of Field
Sort
Show
Criteria
Querying a database involves more than limiting
its display to specific fields. You usually want to
extract records from the table that meet a
given condition. To limit the records that
display in a datasheet, you enter a Conditional
statement in the Criteria row of the grid.
Example:
…Cont
To retrieve all you employees who last name is Harvey:
1. Ensure that the Queries tab is active. Click New
command button, then Double click Design View.
2. In the Show table dialog box that appears select
Employee table, click add button, click close button, the
query Design window appears with the Employees table
in the top portion and a clean grid below.
3. Double click on all desired field in the table object to
add the field to the next available column in the grid.
…Cont
4. Type Harvey in the Criteria row for the Last Name
Column.
LastName
Column
Design
Grid
Delete Query
You can use the Delete Query to deletes of entire groups of
records.
1. Select the table whose record you want to
make another table.
2. In the Query Design View, click the Query type
icon, and then click Delete Query.
3. In the Table Name box, enter the name of the
table you want to create or replace.
4. Click Current Database to put the new table in
the currently open database. Or click another
Database.
Update Query
You can make global changes to a table.
1. Select the table whose record you want to
make another table.
2. In the Query Design View, click the Query type
icon, and then click Make Table.
3. In the Table Name box, enter the name of the
table you want to create or replace.
4. Click Current Database to put the new table in
the currently open database. Or click another
Database.
Forms
Forms: are designs (layout) you create to
improve the appearance of data from your
tables. Forms can be displayed and printed, the
main use of forms is onscreen, to improve the
interface for the data entry.
Create Form
1. Create Form in Design View
2. Create Form By Using Wizard
Create Forms Using Wizard
1. Click Forms tab.
2. Double-click Create
form by using wizard.
3. The Form Wizard dialog
box will appear.
4. Choose the table from
the Table/Queries box.
5. To include a field:click
the field in the list to
select it.
6. Click Next when you
have moved all fields.
1
2 3
1. Tables/Queries:
2. Available Fields:
Tables/Queries
3. Selected Fields:
Sample of the
Selected
layout
Layout
7. A new window gives a
choice of layout.
8. The wizard will offer some
style, choose one and
click on the Next button.
9. Final Wizard dialog
box, which ask to
create a title for the
form.
10. Click Finish.
Moving from Field to Field
Navigation Bar
Number of columns
Toolbox
نافذة تصميم
) Form (النموذج
…Cont
2. Form View: After you have created a Form in
Design view, you can view it in Form View. You
can look at only one record at a time and
adding new records.
3. Datasheet View: you can view records in row
and column format, so you can many records
at one time.
To switch between views of a Form:
Click the View button on the toolbar. The View
button is a toggle button.
Sections of Form
In Design View, Sections are represented as
bands, and each section that the form contains
is represented once.
Switch to Design view, display all the form
sections by selecting Page Header/Footer and
Form Header/Footer from the View menu.
Sections of Form:
1. Form Header: display information that remains
the same for every record, such as a title for
the form. Appears at the top of the screen in
the Form View.
2. Page Header: Display information at
the top of every printed page.
3. Detail section: Is where you specify
which fields will be displayed, what
they will look like.
4. Page Footer: Displays information at
the bottom of every printed page.
5. Form Footer: Displays information
that remains the same for every
record, Appears at the bottom of
the screen in the Form View, after
the last detail section.
Section Size
Change either height or width:
1. Change either height or width by placing the
pointer on the bottom edge or right edge to
the section.
2. Drag the pointer up or down to change the
height of the section. Drag the pointer left or
right to change the width of the section.
Multiple Table Forms
Create form with data from different tables:
1. Establish a relationship between the desired
tables in the database.
2. Create a new query using the desired tables.
3. Specify the field you want to appear in the
form, and then save the query.
4. Create a new form based on the query.
5. A form window will appear in Design view,
click the Field List icon on the toolbar to
display the field of the query.
New
Button
Field
List
Report
Reports are used
to present
summarize, and
print the table
data. Using a
report you can
calculate totals
and subtotals
across a set of
records and
tables.
Create a Report by Using Auto
report
1. Click Reports under Objects.
2. Click the New button on the Database window
toolbar.
3. In the New Report dialog box, click one of the
following Wizard.
AutoReport: Columnar Each field appears
on a separate line with a label to its left.
AutoReport: Tabular the Field in each record
appear on one line, and the labels print once
at the top of each page.
…Cont
New
Button
New
Report
Dialog
Select
the table
or query
…Cont
4. Click the table or
query that contains
the data you want
to base your report
on.
5. Click OK.
Create Report by using Wizard
Report Wizard is the easiest to use because
Access performs all of the work without
prompting you for any information.
Creating a Report:
1. Double Click on Create Report by using
Wizard.
Report
Choose Table
Wizard
dialog box
Choose
Field
2. Choose table on which to base your new
Report.
3. Click Next, new dialog box will appear to
specify the desired grouping option
Group the
record by
the content
of a
particular
field
4. Click next, new dialog box will appear to
specify the desired sorting options for the
derail records.
Style Name
( Format of Layout)
6. In the final dialog
box, you enter a
name for the Report,
then Click Finish.
Name of
Report
Views of a Report
Click the View button on the toolbar.
To display the Print Preview window click.
To return to the report in Design view click.