MS_Access_Part_II
MS_Access_Part_II
(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).
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.
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.
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.
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.
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.
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.
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.
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.
You can experiment with this Report and the Formatting Tab/Ribbon as you desire.
Congratulations!
You now know enough to
be dangerous.