Database Forms and Reports

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 25

DATABASE

FORMS AND
REPORTS
CHAPTER 6
FORM
In a database context, a form is a
window or screen that contains
numerous fields, or spaces to enter
data.
A Database Form is a window with
information fields that help gather
information to be stored in a
database or trigger a process.
THREE MAJOR SECTIONS
OF A FORM
ADVANTAGES OF USING
DATABASE FORM
Datasheet displays may records at
once.
A form can display all the data-entry
textboxes for an entire record in one
screen.
Forms can be customized.
USING FORMS FOR INPUT
AND OUTPUT TASK

causes Access to display the first record in the underlying


database table
displays the last record in the table

symbol displays the next record after the current one.

displays the record just before the current one


USING FORMS TO CREATE
NEW RECORDS
 If you wish to add a new record, you can use a
form for this task as well. First, click on the >*
symbol in the navigation bar. The system will
then display the first available empty record
and allow you to enter the information for a
new table entity—for example, the data for a
new customer.
SUBFORMS:
SHOWING DATA
FROM MULTIPLE
TABLES
Subform
A display of data that is related to
the information in the main form.

Some advantages of
a Subform
1. Ability to display subordinate
information related to the
information in the main form.

2. Useful in entering data in the same


manner that is being used in regular
forms.
CREATING SUBFORMS
 Before anything else, make sure that the data in the two tables are related
via the Relationships window.
Now, the two principle ways of creating a form with a subform:
1. Identify the subform at the time you use the Form Wizard; or
-If a one-to-many relationship exists between the two tables, the Form
Wizard will recognize your wish to create a subform within your main form
and will create one for you.
2. Add one form to an existing form after you’ve created it.
-This procedure causes Access to launch the Subform Wizard, which will
ask you for setting information.
DATABASE
REPORTS

Reports
provide custom information to
database users.

Reports can be simple


documents that only output the
contents of a table, or complex
outputs that combine the
information from several tables
and show selected subsets of
database information.
CREATING SIMPLE REPORTS
Creating such report is not to use your database system at all, but rather to
decide what information to include in the report and how best to display that
information in a printed document.
Seven Major Components of a Database Report:
Component Where it appears Typical component
Report Header First page of the report. Company name and address, date
prepared or relevant time period,
company logo.
Page Header Top of each page. Identification of each data field below
it.
Group Header Beginning of each group of records. Identification of a new group of data.
Detail Lines Body of the report. The individual data fields of, and
computed data fields from, underlying
database tables.
Group Footer End of each group. Control totals or other statistics such as
maximums, minimums or averages for
the group.
Page Footer Bottom of each page. Page number, report number.
Report Footer Last page of the report. End-of-report identifier, grand totals.
USING REPORT
WIZARD IN
ACCESS, THESE
ARE THE STEPS:
STEP 1: Launch the
Report Wizard
Select the Create
option from the
main menu and then
select “Report
Wizard”.
USING REPORT
WIZARD IN
ACCESS, THESE
ARE THE STEPS:
STEP 2: Select the
Underlying Data Source
and Desired Fields.
To create a report, we
will only need the
Customers table. Thus, to
replicate our work, select
tbl BSN Customer Master
Table from the drop-down
list in Figure 6-10a and
then select the
appropriate fields using
the data field selector
buttons(> and >>) as
needed.
USING REPORT
WIZARD IN
ACCESS, THESE
ARE THE STEPS:
STEP 3: Indicate any
Grouping Levels.
When you click “Next”,
you will see the dialog
box. This is where you tell
the Report Wizard how
you would like to group
your data.
USING REPORT
WIZARD IN
ACCESS, THESE
ARE THE STEPS:
Step 4: Indicate any Sort
Fields and Select the
Desired Report Format. T
The Report Wizard also
allows you to sort up to
four different fields. After
you have selected the
sort fields, click “Next” in
the dialog box. The fourth
screen in the Report
Wizard appears and
allows you to select a
particular report layout.
USING REPORT
WIZARD IN
ACCESS, THESE
ARE THE STEPS:
Step 5: Select a Desired
Report Style and Name
the Report.
After clicking Next in the
dialog box, you will see
the dialog box and this
will enable you to select a
report style. Finally, when
you click the “Next” in
the dialog screen, you
will have the opportunity
to name your report. (rpt)
USING REPORT
WIZARD IN
ACCESS, THESE
ARE THE STEPS:
Step 6: Modify the Design
of the Report as Desired.
When you finish with the
Report Wizard, you will
probably need to modify
the report design still
further.
CREATING REPORTS WITH
CALCULATED FIELDS
 A common task when creating reports is to include calculated fields in
them. For example, a report of employee information might also include a
field entitled ‘‘years of service,’’ which the system can calculate from the
employee’s date of hire. Sometimes, you want a calculated field to appear
in the detail section of a report, and at other times you want group or
grand totals to appear in the group footer or the report footer sections of
your report.
CREATING
REPORTS WITH
CALCULATED
FIELDS, THESE
ARE THE STEPS:
Step 1: Create the Query
with a Calculated Field
We begin by selecting the
tables needed for this task.
In this, we need 2 tables. One
such table is the Customer
Invoice Details table which
contain the item number and
the quantity ordered, but not
the name of the item
purchased or its price. For
this information, we need the
Products_And_Services table.
CREATING
REPORTS WITH
CALCULATED
FIELDS, THESE
ARE THE STEPS:
Step 1: Create the Query
with a Calculated Field
We begin by selecting the
tables needed for this task.
In this, we need 2 tables. One
such table is the Customer
Invoice Details table which
contain the item number and
the quantity ordered, but not
the name of the item
purchased or its price. For
this information, we need the
Products_And_Services table.
CREATING
REPORTS WITH
CALCULATED
FIELDS, THESE
ARE THE STEPS:
Step 2: Create the Report Based
on Your Query.

To create the calculated field, select the first


available column in the query design screen
and type the name of your calculated field
but be careful not to choose a term with the
same name as an existing data field.
Type a colon following your calculated field
name and then input the formula for your
calculated field. Use an asterisk for a
multiplication sign and a forward slash (/) for
a division sign.
Also, be careful to spell the field names in
your formulas exactly as they appear in your
underlying database tables.
CREATING
REPORTS WITH
CALCULATED
FIELDS, THESE
ARE THE STEPS:
Step 3: Place square
brackets around your field
names.
Finally, place square brackets
around your field names to indicate
that you are referencing existing
data fields.
When you have completed your
query, you can test it by clicking on
the Run button (with exclamation
point icon) in the main menu. If
things work properly, you will see
something like this in the screen.
CREATING REPORTS WITH
GROUPED DATA
 Control breaks are often the point at which managers want to see
subtotals, maximums, minimums, averages, or similar subgroup
summaries.
 A control break is the technical term for the point at which a group changes
from one type to the next in a report.
 Examples of control breaks include a change in zip code for the addresses
in customer listings, a change in the department number for a listing of
employees, and a change in a service classification for the yellow pages of
a phone book.
CREATING
REPORTS WITH
CALCULATED
FIELDS, THESE
ARE THE STEPS:
Step 1: Create the
Underlying Query.
The upper portion of the query
screen identifies the four
tables required to build it.
CREATING
REPORTS WITH
CALCULATED
FIELDS, THESE
ARE THE STEPS:
Step 2: Use the Report
Wizard to Create the Initial
Report.
After creating our initial query,
we will then go the Reports
portion of Access and use the
Report Wizard to create an
initial report.
CREATING
REPORTS WITH
CALCULATED
FIELDS, THESE
ARE THE STEPS:
Step 3: Reformat the Report as
Desired.
You should expand the size of
unbound labels so that their entire
text shows.
You can delete any control you
don’t need.
You can move both bound and
unbound controls from one part of a
report to another.
The Format menu enables you to
resize, align, and reposition multiple
objects consistently on your report.

You might also like