You are on page 1of 54

Microsoft Access Level I

Microsoft Office
Microsoft Access 2007


Microsoft
Database





(Data)


Database





Database



( i)

Microsoft Access Level I

E-Book: Microsoft Access 2007 Step by Step


E-Book: Microsoft Access 2007 For Beginner
www.google.com

( ii)

Microsoft Access Level I

........................................................................................................................................1
Microsoft Access .................................................................... 2
Microsoft Access 2007 (How To Open Ms. Access 2007) ............................... 2

I.


Blank Database ......................................................................... 3

II.
II.1.

Blank Database ................................................................................................... 3

II.2.

Interface Microsoft Access ......................................................................... 4

Table ......................................................................................................... 5
Table (How To Create Table) ................................................................................... 5

I.

I.1.

Table .............................................................................................................. 5

a.

Table Datasheet View .......................................................................... 5

b.

Table Table Template .......................................................................... 5

c.

Table Design View .............................................................................. 6

I.2.

Format Field Table (Data Type) ....................................................... 6

II.

Format Property Data Type................................................................ 7

III.

Primary Key Foreign Key ....................................................................... 7

III.1.

Primary Key .................................................................................................. 7

III.2.

Foreign Key ................................................................................................ 8

Lookup Wizard....................................................................................................... 8

IV.
IV.1.

Lookup Wizard ............................................................................................ 10

V.

Export Table Database .................................................................................. 11

VI.

Import Table Database ................................................................................. 12

.............................................................................................................................

13

(Relationship) .............................................................................. 17
I.

(Relationship)............................................................................................. 17
I.1.

(One To One) ................................................................ 17

I.2.

(One To Many)............................................................ 17

I.3.

(Many To Many) ....................................................... 17

( iii)

Microsoft Access Level I

Query....................................................................................................... 19
I.

Query ................................................................................................................... 19
I.1.

QueryQuery Wizard ......................................................................... 19

I.2.

QueryQuery Design .......................................................................... 20

II.



Query ................................................................................ 21

III.

AggregateFunction ......................................................................................... 22

IV.

SQL Statement Query ............................................................................... 22

IV.1.

Select Statement ....................................................................................... 22

IV.2.

Insert Statement ....................................................................................... 22

IV.3.

Update Statement ..................................................................................... 23

IV.4.

Delete Statement ...................................................................................... 23

........................................................................................................................... 24
Form .................................................................................................. 26
I.

Form .................................................................................................................... 26
I.1.

Form Form Wizard ............................................................................ 26

I.2.

FormForm Design............................................................................. 27

I.3.

Form Multiple Items .......................................................................... 28

II.

Sub Form .............................................................................................................. 28

III.

Control Form............................................................................................. 29

IV.


Form.................................................................................................... 30

.............................................................................................................................

31
(Report Object.................................................................... 35
I.

(Report Object) ................................................................................... 35


I.1.

Report? ................................................................................................................ 35

I.2.

Report ............................................................................................................... 35

a)

Report Report Wizard ........................................................................ 35

b)

Report Report Design ........................................................................ 36

.............................................................................................................................

38

Macro ..................................................................................................... 41

( iv)


I.

Microsoft Access Level I


Macro ................................................................................................................. 41

II.

Action Macro................................................................................................... 42

III.

Macro Form
.............................................................. 42

IV.

Switchboard Manager ..................................................................................... 44

.............................................................................................................................

46

( v)

Microsoft Access Level I


Microsoft Access



(Data) Database




Database






Hyperlink




Database
(
)

Database Report

Database

Database



-

Database


Users

Users

Users




Update

Database

Backup



Database

(Restore)



Backup

( 1)

I.

Microsoft Access Level I

Microsoft Access 2007

Microsoft Access 2007 (How To Open Ms. Access 2007)


Microsoft Access



:
Icon Microsoft Access Desktop


(Double Click)Right => Open

Icon

:
Start => Programs => Microsoft Office =>

Microsoft Access 2007

( 2)

Microsoft Access Level I

:
Start => Run => Msaccess

Open => OK

II.




Blank Database
II.1. Blank Database

Microsoft Access


Alert


Microsoft Access
Database

Save


Icon Blank Database





File Name

Database

Database
Create

Blank Database

( 3)

Microsoft Access Level I

Microsoft Access
Object
o Table:

o Query:

Table
o Form:



Table


o Report:


o Macro:
Action
o Module:

II.2. Interface Microsoft Access


Database
Interface Microsoft Access

Ribbon Option

Title Toolbar

Office Button

Close

Minimize

Objects Name

Maximize
Quick Access Toolbar

Field/Colum

Record/Row

Office Button:

Microsoft Access 2007
Quick Access Toolbar: Undo, Redo, Save,...
Ribbon Bar: Option Microsoft Access

Option

( 4)


I.

Microsoft Access Level I

Table

Table (How To Create Table)


Table


Field/Column

Record/Row
Table
I.1.
Microsoft Access 2007

Table Datasheet
View, Table Template Table Design View
a. Table Datasheet View
Datasheet View Simple Table Blank


Database
Table Datasheet View Create => Table

b. Table Table Template

Microsoft Access

Table Template Table
Table Template Create => Table Template

( 5)

Microsoft Access Level I

c. Table Design View


Table Design View Table


Create => Table Design
Format Field

I.2.

Format Field Table (Data Type)





Field

(Data

Type)


Field Name
Data Type
Text

Description

Storage Size



Text Number 255

Memo

Text

64 Kb
64 000

Number

1, 2, 4, 8 bytes

Date/Time

8 bytes

Currency

8 bytes

AutoNumber

4 bytes

Yes/No



Boolean True or False

4 bytes

OEL Object



Object , 1 Gigabyte

World Document Excel

Hyperlink



Hyperlink Address

Attachment



Attach E-mail

Look Wizard




Table

2048 bytes

( 6)


II.

Microsoft Access Level I

Format Property Data Type





Field


Format Property Data Type



Format Property


-

Field Size: Data Type

Format:
Format

Decimal Place:

Input Mask:


Password

Field
Caption:

Default:

Default Default

Validation Rule:

Data Type Field

Validation Text:


Validation Role


Invalid To Input Please Try Again!

Required: Field Yes

Indexed:


Text Align:
Text (Left, Right, Center,)

III.

Primary Key Foreign Key

III.1. Primary Key

( 7)

Microsoft Access Level I

Primary Key Key





Field Field ID User

Primary Key Select Field Primary Key

Primary Key ( )

Kjklj Select Field Name


III.2. Foreign Key
Foreign Key Key
Foreign Key Key

Primary Key Table

(Relationship)
Table
Primary Key

Foreign Key

IV.

Lookup Wizard
Lookup Wizard



Field

Users



Lookup Wizard

Select Field
Data Type Lookup Wizard

( 8)

Microsoft Access Level I

Lookup Wizard


Lookup Wizard
-

I want the lookup column to look up the values in a table or query:

Lookup Wizard


Table or Query
-

I will type in the values that I want:




I will type in the values that I want => Next =>






LookupWizard Dialog Box





Next

( 9)

Microsoft Access Level I

Finish

IV.1.

Lookup Wizard

Lookup Wizard





Table

Lookup Wizard Design View
Select Field Data Type Lookup Wizard
Select LookupRow Source


( 10)


V.

Microsoft Access Level I

Export Table Database


Export
Table Database Database

Export Table

Select Table
Export

Right Click => Export => Access Database


Alert

Browse
Export Access Database
Database
Export
OK

Browse
Database

Export
OK

( 11)


VI.

Microsoft Access Level I

Import Table Database


Import Table Database Database

Import Table

Database
Import Table

Click External Data => Access

Database
Browse
Import => OK

Browse
Database

Table Import OK

Table

( 12)

Microsoft Access Level I


Table
1. Table (TblCustomers) Field Data Type (CusId Primary Key)

2. Table (TblEmployees) Field Data Type (EmpId Primary Key)

( 13)

Microsoft Access Level I

3. Table (TblImports) Field Data Type (ImportId Primary Key)

4. Table (TblOrderDetails) Field Data Type (Primary Key)

( 14)

Microsoft Access Level I

5. Table (TblOrders) Field Data Type (OrderId Primary Key)

6. Table (TblStocks) Field Data Type (PId Primary Key)

( 15)

Microsoft Access Level I

7. Table (TblSuppliers) Field Data Type (SupId Primary Key)

( 16)

I.

Microsoft Access Level I

Relationship

(Relationship)
Relationship Table 2 Database Field

Primary Key Table


Foreign Key Table
Relationship Database Tools => Relationship

Relationship
I.1.
-

(One To One)
One To One : Field Table A

Field Table B Field


Table B
Field Table A

I.2.
-

(One To Many)
One To Many : Field Table A

Field Table B Field


Table B
Field Table A

I.3.
-

(Many To Many)
Many To Many : Field Table A

Field Table B Field

Table B

Field Table A

( 17)

Microsoft Access Level I

Relationship
Alert

Show Table
Add Table
Relationship

Field

Primary Key Table Field


Foreign Key Table

Select
Enforce Referential Integrity
Cascade Update Related Fields
Cascade Delete Relate Record

Table

( 18)

I.

Microsoft Access Level I

Query SQL

Query
Query Object


Table

Query
I.1. QueryQuery Wizard
Query Wizard Create => Query WizardGroup Other

Simple Query Wizard




Dialog box => OK

( 19)

Microsoft Access Level I

Field Select

Field


Select Table Table/Queries Next


Finish

I.2. QueryQuery Design


Create => Query Design =>


Table
1

( 20)

Microsoft Access Level I

II.



Query



Table Query

Operator
Operator

Description

<

<=

>

>=

<>

And
Or
Like
Between


/

/





In

Or

Not

<>

Is Null



Field

( 21)


III.

Microsoft Access Level I

AggregateFunction
Avg:
Max: Field
Min: Field
Count:
Record Field
Sum:
Field
IIF:

Datediff:

IV.

SQL Statement Query



SQL (Structure Query Language)



Table
IV.1. Select Statement



Table

Syntax 1:
SELECT Field Name 1, Field Name 2,
FROM Table Name;

Syntax 2:
SELECT *
FROM Table Name;

Syntax 3:
SELECT Field Name 1, Field Name 2,
FROM Table Name;
WHERE Conditional;
IV.2. Insert Statement
Insert Statement


Table

Syntax 1:
INSERT INTO Table Name
VALUES (Field1 Value, Field2 Value,)

( 22)

Microsoft Access Level I

Syntax 2:
INSERT INTO Table Name(Field Name 1, Field Name 2,)
VALUES (Field1 Value, Field2 Value,)
IV.3. Update Statement
Update Statement


Table

Syntax:
UPDATE Table Name
SET Field Name 1 = Value 1, Field Name 2 = Value 2,
WHERE Conditional;
IV.4. Delete Statement


Delete Statement


Table

Syntax:
DELETE *
FROM Table Name
WHERE Conditional;

( 23)

Microsoft Access Level I


Query Wizard



1.



Field (CusID, CusName, CusSex, CusAddress) Tbl Customers
2.



Field (EmpID, EmpName, EmpSex, EmpPhone, EmpPosition,
EmpSalary) TblEmployee
3.



Field(ImpDate, Pid, Qty, Up) TblImports
4.



Field TblOrders
5.



Field TblOrderDetails
Query Design



a.



Field (CusName) TblOrder

Field(CusName)
TblCustomers

Field (OrderDate) TblOrders


Field (Pid) TblOrderDetials

Field (PName) TblStocks


Field (Up) TblOrderDetials


Field (EmpName)
TblEmployees
b.



Field (CusName) TblOrder

Field(CusName)
TblCustomers

Field (OrderDate) TblOrders


Field (Pid) TblOrderDetials

Field (PName) TblStocks


Field (Up) TblOrderDetials


Field (EmpName)
TblEmployeesOrder 03-Jan-2013
c.



Field (CusName, CusSex) TblCustomers, Field (Orderid,
OrderDate) TblOrders, Field (Qty, Up) TblOrderDetails, Field (PName) Table
Stocks Qty200




Customers
012




Field (CusName, CusSex) Table Customers, Field (Orderid,
OrderDate) Table Orders, Field (Qty, Up) Table OrderDetail, Field (PName)
Table Stocks Qty200 500
Customer Id 1, 3, 5

( 24)

Microsoft Access Level I


Employee 011


Customers

Customers


20 200
ABC
Aggregate Function

Field Up TblOrderDatails
Field Qty TblOrderDatails
Field Up TblOrderDatails

Field Pid Table Stocks


Field
2 TblOrderDatails (Total and Discount) Field
Total
Field Discount

$500 5%

$400 4%

$300 3%

$200 2%

$100 1%



Table Employees
Field
Age

SQL Statement





Field CusID, CusName, CusSex and CusPhone Table Customers
Select Statement



Table Employees Select Statement



Field Table Customers

Update Data Table Employees
(id 1)
200

Id 3 Table Customers

Delete

( 25)

I.

Microsoft Access Level I

Form

Form
Form Object
Interface


Form

Form

I.1. Form Form Wizard
Form Wizard Form Microsoft Access

Form
Design Form
Form Wizard Create => More Form => Form Wizard

Form Wizard

( 26)

Microsoft Access Level I




Tables Queries
Tables/Queries => Next

Form => Next => Finish



I.2. FormForm Design


Form Design Form
Interface

Create => Form DesignForm Groups

( 27)

Microsoft Access Level I


Add Existing Field
Table Field Table
Form

I.3. Form Multiple Items



Multiple Item Form Form

List
Create => Multiple Items Form

II.

Sub Form
Sub Form
Sub Form Form Form

Control Sub Form


Form Form Design
Form
Sub Form
Form

( 28)

Microsoft Access Level I

Sub Form

III.

Control Form
1

11

12 14

10

13

15


1. Logo:
Logo


2. Title:


3. Page Number:

4. Date and Time:

5. Text Box:


6. Label:

7. Command Button:




( 29)

Microsoft Access Level I

8. Combo Box:




9. List Box:



10. Sub Form:
Sub Form Form

11. Option Group:
Check Box Option Control
12. Check Box:
Check
13. Option Button:
Select
14. Tab Control:


Form
15. Image:


IV.


Form
Form

Form Design View

Select Form Property Sheet

Picture Property Sheet

( 30)

Microsoft Access Level I


1. Form Wizard Multiple Items Form Form
a. From

b. From

( 31)

Microsoft Access Level I

c. From

d. From

( 32)

Microsoft Access Level I

Form
2. Form Design

a. From

b. From

( 33)

Microsoft Access Level I

c. From

d. From

( 34)

I.

Microsoft Access Level I

(Report Object)

(Report Object)

I.1. Report?

Report Object


Table
Query

I.2. Report
a) Report Report Wizard
Report Create => Report Wizard

Table or Query
Report Combo Box


Field Select >>

>
Report Next
Field

( 35)

Microsoft Access Level I


Combo Box
Shot Field Next

=> Next => Finish


b) Report Report Design

Report Create => Group Report => Report Design

( 36)

Microsoft Access Level I

Report Design View


Header: Title Logo
Detail:

Table or Query
Footer: Page Number

( 37)

Microsoft Access Level I


Report
1. Report Wizard

( 38)

Microsoft Access Level I

( 39)

Microsoft Access Level I

Report
2. Report Design

( 40)

I.

Microsoft Access Level I

Macro


Macro

Object Microsoft Access


Macro Object

Macro Control
Form


Image, Label or Button
Form or Report
Button Open Macro
Macro Create => Macro Group Other

Action Macro

( 41)

Microsoft Access Level I

a. Field Action
Form Report
Run Macro
b. Arguments: Form Report

Detail Action Macro
c. Comment:
Action Macro
II.

Action Macro
Microsoft Access Action Macro

Macro
Table, Query, Form, Report Object

Macro
Report Print Preview


File Microsoft Word, Microsoft Excel Notepad

Records
Macro
Apply Filter
Action Macro Action


o Openable Action: Action
Table
o Open Form: Action
Form
o Open Query: Action
Query
o Open Report: Action
Report


o Close: Action
Form, Report Query
o MsgBox: Action

o Hourglass: Action
Mouse Pointer
o GoToRecord: Action
Cursor Field or Control
o RunCommand: Action
Find, Replace, Export Access or Exit,
III.

Macro Form

Macro Form Form Design


Macro

Where Condition

Form Find Record


Form Customers

( 42)

Microsoft Access Level I

txtname
e

txtid

Right Click => Build Event => Macro Builder

OpenForm Action
Action:

Form Customer
Form Name:
Where Condition

( 43)


IV.

Microsoft Access Level I

Switchboard Manager


Switchboard
Form Report
Switchboard Database Tools => Switchboard Manager


New



Switchboard => OK

Switchboard => Edit




New

Form or Report

( 44)

Microsoft Access Level I

Main Switchboard => Edit



New


Switchboard

( 45)

Microsoft Access Level I


Table, Query,
1.
Form
Macro
Form Report


2. Macro


ID

( 46)

Microsoft Access Level I


3. Macro


ID


4. Macro



ID



ID

( 47)

Microsoft Access Level I


5. Macro


( 48)

You might also like