Lab Assignment 4: Creating Reports
Objective: In this lab
assignment, you will create a report in Microsoft Access to display student
information from the "Student Information" table, format the report
to make it visually appealing, and add a calculated field to display the
student's age based on their date of birth.
Step 1: Open the Existing Database
11. Open Microsoft
Access.
22. Open the existing
database created in previous lab assignments (Lab Assignment 3) or create a new
database if necessary.
Step 2: Create a Report
11. In the Navigation
Pane, select the "Student Information" table.
22. On the
"Create" tab, click "Report Wizard."
33. In the "Report
Wizard" dialog, select the fields you want to include in the report.
Select at least the following fields: Student ID, Name, Date of Birth, and
Email. Click "Next."
44. Choose a grouping
option if you want to group the data by a specific field (e.g., Department).
Click "Next."
55. Choose a layout
style for your report. For this assignment, select "Tabular." Click
"Next."
66. Choose a style for
your report. You can choose any style you prefer, or stick with the default.
Click "Next."
77. Enter a name for
your report (e.g., "Student Report") and choose whether to view the
report immediately. Click "Finish."
Step 3: Format the Report
11. Your report should
now be open in Layout View.
22. Format the report
to make it visually appealing by adjusting column widths, changing fonts, and
adding headers and footers. You can also add colors or borders to make it more
attractive.
33. To add headers and
footers, go to the "Design" tab and select "Header/Footer."
You can add a report title, page numbers, and date as desired.
44. Save the report.
Step 4: Add a Calculated Field for Age
11. In Layout View,
click in the cell where you want to add the calculated field for the student's
age.
22. In the "Field
List" task pane on the right, expand the "Student Information"
table, and drag the "Date of Birth" field onto the cell.
33. In the cell, click
on the "Date of Birth" field to select it.
44. In the
"Properties" pane at the bottom of the screen, go to the
"Data" tab.
55. Under the
"Control Source" property, click the build (ellipsis) button (…) to
open the Expression Builder.
66. In the Expression Builder, enter the following expression to calculate the student's age:
DateDiff("yyyy", [Date of Birth], Date())
This expression calculates the
difference in years between the "Date of Birth" field and the current
date.
77. Click
"OK" to close the Expression Builder.
88. Adjust the
formatting of the calculated field as needed, such as setting the number format
to "General Number" or "Fixed."
Step 5: Save and View the Report
11. Save your report.
22. Go to "Report
View" or "Print Preview" to see how the report looks with the
added calculated age field.
Step 6: Finalize the Assignment
11. Write a short
summary explaining the purpose of your report and the significance of including
the calculated age field.
22. Save the database
with all the changes.
Your lab assignment is now complete. This report displays student
information and includes a calculated age field. You can adjust the formatting
and layout to meet your specific preferences or requirements.