0% found this document useful (0 votes)
3 views

MS_Access_Part_II

Uploaded by

Kasun Madusanka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

MS_Access_Part_II

Uploaded by

Kasun Madusanka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Microsoft ACCESS

(Part-II)

Faculty of Engineering
University of Ruhuna
June 2020 Dr. J.M. Ruwan S. Appuhamy
Entering Data in the Database – (cont.)
There are 2 methods for entering data into the database:
1. The method you just used is called Datasheet View method.
or
2. You can use the Form View method (we’ll create a Form in a bit later).

Exiting and Saving


Anytime you need to leave your database, click the
Microsoft Office Button, then click Exit Access. If you
have not saved your spreadsheet, a reminder box will appear
asking you to do so.

Notice the Access Options button to the left of Exit Access. Click the Access
Options button. The Access Options menu screen will appear. As you can
see, all of the choices available under File in the menu bar are here – as well as
many more.
Exiting and Saving – (cont.)
Access Options screen will display as bellow.

As you can see, you can Customize the Quick Access Toolbar or if you click
the Resources, you will see some great on-line resources available to assist you
with Access.
After you have reviewed the Access Microsoft
Office button choices, click the Exit Access
button.
Opening Access Database - Again
Now, click Access 2007 to start it again.
A neat thing about Access 2007 is the Open Recent
Database area on the right side of the screen. You can simply
click-on the file, EmployeeData, and it will open.
When Access 2007 opens, you will see that the bottom portion of your screen is
blue and that the below message appears above the blue area.
Access has long been a source for worms and viruses when e-mailed to other
people, so Access 2007 has this additional feature to protect you. Click the
Options button.

Then the Microsoft Office Security Options menu


screen will appear. Take a few minutes to read
this information.
Since you are opening your own database, click
the small circle of Enable this content and then
click the OK button.
Opening Access Database - Again
Now, you can see that your Employee:Table turns orange.
This means that it is OK.

Now, either double click on Employee:Table or right click


and select Open to open the Datasheet View.

Form View and Datasheet View


As indicated previously, you can use either the Datasheet View, like we have
done so far, or you can use a Form to enter your data. Both methods work well.

Let’s create a Form now.


Click the Create Tab. Look in the Create
Ribbon in the forms Group and you’ll see the
Form button. Click the Form button.
Creating a Form
Following screen will appear. The first thing you’ll notice is that Access 2007 –
knowing you were entering data from the Employee Table – created a Form with
all of the Fields in your Table! You’re ready to enter data in this form.

Another new feature of Access


2007 is the Tab layout for what
you’re working with. Look just
above the Form and you will see
two Tabs (Employee Datasheet
and Employee Form).

Now let’s save your Form. Either click the or right click
Employee form and click save.
Now let’s enter some data in the Form View. You can use the arrows to switch
between records and arrow with (*) will lead you to a new record filling.
Creating a Form – (cont.)
You can switch back and forth from the Datasheet entry to the Form entry by
clicking on your choice.
The View buttons on the upper left indicate what “view” you are using: Design
View, Form View, or Datasheet View.

Note, that you have to make sure


you are in either Form View or
Datasheet View, if you want to
add new data (NOT Layout or
Design Views).

Important
To record enough information so that you can see the power of Access database
does enter 14 or more records now. You may use either Form View or
Datasheet View.
Querying the Database
This is what a database is designed for: finding specific information about
some of the data in the table(s) very quickly.
A query is a search for general or specific data in a field or fields in your
database (e.g. the first and last names of all employees, the people from Galle,
salaries > Rs.75,000, etc.). In order to do this, we need to click on the fields we
want to query. So, let’s start a query.

NOTE:
Make sure you are in the Employee Database. If your Datasheet or Form open
(to add data), close them before you begin your queries. The Access program
sometimes becomes logically confused and you may see “error” messages if you
leave the Form or Datasheet open.

Click the Create Tab.


Then move your cursor
over the Query Design
Button in the Create
Tab/Ribbon.
Querying the Database – (cont.)
Two new windows will appear: Query 1: Tab and Show
Table. You will first have to select the table(s) you desire to
query.
Click Add First
Now your screen will
look like this.
Then click Close

What we need to do
next is place the
Fields we want to Here, you can either double click
query in the lower on LastName in Employee table
area of the screen. or click arrow in Field to select
the desired field.
Querying the Database – (cont.)
Now move to the next Field cell on the right and select FirstName, Gender,
City, Favorite Number and Salary(Rs). Your Query1: Select Query screen should
look like this:

Your query
Now, look in the
screen should
Button Bar and
look similar to
you will see an
this and notice,
exclamation mark
the screen
(!). Click-on (!).
ONLY shows
This click executes
the 6 fields that
your query.
you queried.
Querying the Database – (cont.)
You can add or remove fields, as you desire. To do this we need to
return to the Design View where we created this query.

To see how your query will look,


if you print it, check in the
Print Preview.

Now you can close the print


preview and Save your query.
Sorting the Database
If you are not in the Query Design Screen, you’ll need to be
in that view. Click-in the Sort: area under Last Name. A
down arrow box appears; click-on the down arrow. Let's
sort the Last Names in Ascending order. Click-on
Ascending. Click-on the ( ! ) to see the new query. Notice
that the names you entered are alphabetized.
When you are finished, remember to set the fields to (not sorted) unless you do
want to sort on those fields.
Also you can sort by using
“Sort & Filter Group” or by
using “small down arrow” in
each field.
Specific Queries
So far we have listed everything under each Field Name that we selected.
However, many times you will probably want to find something specific in your
Table (database - e.g. people from a certain city, people whose favorite number
is 7 or salaries between Rs. 50,000 and Rs. 100,000).
To get an idea of various criteria (you might want to use),
click-on the Help Question Mark.

Type-in “query criteria” and then tap the Enter key.

Here, by clicking
any result, you
can get a good
information on
that topic.
Specific Queries – (cont.)
Now we'll try a few specific queries. Make sure that you are in “Query Design
View”. First let's find a specific town (ex: Peradeniya).
Click-in the cell of Criteria: in the City column. Type-in
the “Paeradeniya”. Now click-on (!). A new Query1
window will appear with only persons from Peradeniya.

Return to Query Design View.


Delete the City you entered.
Now we'll look for Favorite Click-on (!). Everyone with a favorite number
Numbers larger than 500. larger than 500 should show.
Type-in > 500 in the Criteria
cell under the FavoriteNo
Column.
Specific Queries – (cont.)
Next we'll look for persons with salaries equal to or larger than Rs. 50,000 and
equal to or less than Rs. 100,000. In the Salary field column, in the Criteria: cell
type-in:
>= 50000 and <= 100000

Click-on (!).
You should now see a specific query
that indicates those persons in the
range you chose.

Go back to Design View. Delete the criteria you entered under Salary.
Now, on your own, add or delete some fields to your query and experiment with
some combinations.
Finally, save your query.
Reports
First, make sure that you have closed any Tables, Forms, or Queries on which
you are open.
Click the Create Tab and the Create Ribbon will appear. Look at the Ribbon
on the right side. You will see the Create Reports Group.

First, we’ll begin our Report lesson using the Report


Wizard. Once you’ve created a Report with the Wizard,
you’ll be somewhat familiar with Reports.
Click the Report Wizard selection in the Reports Group.
Only the fields you select from
your table will show-in the report.
Click-on the name of the field and
then click-on the >. The order
which you click-on the fields will
be their order in the report.
Reports – (cont.)
Let's begin. Click-on Title, then click-on > (notice how the Title field went from
the Available Fields: to Selected Fields:). Now do the same with the FirstName,
LastName, City, Gender and Salary(Rs) fields.
Your Report Wizard menu screen should look like the one below.

If it does, click-on the Next > Button.

Grouping in Reports
Grouping simply “groups” records by an item in the report you are designing.
We’ll group by Title. This means that “records” from a particular title will be in
a “group” (e.g. people Professors will be in one group, and so on). So, click-on
Title, then click-on >.
Reports – (cont.)
Now you need to indicate a Sort Order. This simply means that within each
“group”, the alphabetic order in which you want the fields sorted. We’ll sort by
Last Name and then First Name.

Notice the Ascending button to the right


of the Sort boxes. If you click-on this
button, it will reverse the order to
descending order.
The Summary Options box ONLY
appears when a number field is selected!
Click-on the Summary Options… button.

The Summary Options menu box allows


you to enter calculations for numerical
and currency fields if you have selected
any. It will summarize these calculations
by each group, and in total. Click-in the
boxes under Sum and Avg.
Reports – (cont.)
Click-on OK. This will return you to the previous Wizard screen. Click-on Next >
again.
This Report Wizard screen allows you to select
a layout for your report. Click-in the small
circles to the left of each choice in the Layout
area and observe the results. For the moment,
we’ll stay with the default: Stepped.
Note: There is a check in the small box of
Adjust the field width so all fields fit on a
page. This is a very important check. This
means that no matter how many fields you place
in your report, they will all fit on one page.
Click Next again.
This menu screen allows you to select the Style
that you would like for your report. Click-on the
choices (Apex, Aspect, etc.) and see what each
“looks like”. Choose whichever style you desire
and click-on Next > again.
Reports – (cont.)
Let’s title this report “Employees Report”. Use this name, or any name you
desire, and click-on Finish.
This is a report in Tabular (Columnar)
format.

Now, if you want to change the size of the rows or particular


item, close Print preview and click, View and then again click on
“Design View”.
Reports – (cont.)
You will get the bellow screen.
Here, you will see your report
layout and also note you can add
new fields with the help of
toolbar available on top.
Ex: Lets add “Logo” to our
report.

Click on “Logo” and select the desired logo


from your file directory.

You can add any other field as you like and also change the sizes, location etc.
of each box.
Reports – (cont.)
Now let’s enlarge the Salary, Sum and Average “boxes”.
In Design View, click on the
Salary(Rs) box in the Detail area.
The border around the box will
turn orange. Carefully move your
cursor.

Now move to the Title Footer area and do the same


for the Sum box.
And, then the Average box.

Now, check a “Print Preview” to see


how your report looks like.
Then, Save your report.
A quick report also can be obtained by
clicking “Create” and then again click-
in “Report”.
Reports – (cont.)
Notice that Access has chosen a name for the Report based on the name of your
Table.

You can experiment with this Report and the Formatting Tab/Ribbon as you desire.

Congratulations!
You now know enough to
be dangerous.

You might also like