Lesson 40 of 50 – Report Totals in MS Access
80%

Report Totals in MS Access

Report totals in Microsoft Access help you summarize information displayed in a report. You can calculate the sum, count, average, maximum, and minimum of values. These calculations are useful for preparing fee reports, sales reports, student summaries, and financial reports.

1. What Are Report Totals?

Report totals are calculated values that summarize records in a report. Totals can be displayed for the entire report or for individual groups.

Example: Student Fee Report
Student ID Student Name Course Fee Paid
101 Rahul Kumar ADCA ₹5,000
102 Priya Singh Tally Prime ₹4,000
103 Amit Kumar ADCA ₹3,000

Total Fee Paid: ₹12,000

The report can display the total fee paid by all students instead of requiring you to add the values manually.

2. Common Aggregate Functions

Aggregate functions calculate summary values from multiple records.

Function Purpose Example
Sum Adds numeric values. Total fees paid.
Count Counts records or non-null values, depending on the expression. Number of students.
Average (Avg) Calculates the arithmetic mean. Average marks.
Maximum (Max) Finds the largest value. Highest fee payment.
Minimum (Min) Finds the smallest value. Lowest fee payment.
Remember: Sum and Average generally require numeric values. Count can count records or non-null field values, depending on the expression used.

3. Adding a Total to a Report

You can add a calculated control to a report to display a total. The expression used depends on the field and the calculation you want to perform.

Steps
  1. Open your report in Design View.
  2. Identify the section where the total should appear.
  3. Add a text box using the Design tab.
  4. Select the text box and press F4 to open the Property Sheet.
  5. Set the Control Source property to the required expression.
  6. Save and preview the report.
Example: Calculate Total Fees

If the numeric field is named FeePaid, use this Control Source expression:

=Sum([FeePaid])

The expression calculates the sum of FeePaid values within the applicable report or group scope.

Important: Use the actual field name from your table or query. Field names containing spaces should be enclosed in square brackets.

4. Calculating the Grand Total

A grand total summarizes all applicable records in the report. For example, it can show the total fees paid by every student included in the report.

Steps
  1. Open the report in Design View.
  2. Make sure the Report Footer section is visible.
  3. Add a text box to the Report Footer.
  4. Set its Control Source to the required aggregate expression.
  5. Add a label such as Grand Total.
  6. Save the report and check the result.
Example Expression
=Sum([FeePaid])

When placed in the Report Footer, this expression generally displays the sum for the report's records.

Result: A grand total provides one summary value for the report rather than a separate value for each group.

5. Calculating Group Totals

Group totals calculate values separately for each group in a report. For example, a course-wise fee report can display the total fees paid by students in each course.

Example
Course Student Fee Paid
ADCA Rahul Kumar ₹5,000
ADCA Amit Kumar ₹3,000
Tally Prime Priya Singh ₹4,000
Expected Summary

ADCA Total: ₹8,000

Tally Prime Total: ₹4,000


Grand Total: ₹12,000

Steps
  1. Open the report in Design View.
  2. Open the Group & Sort pane.
  3. Group the report by Course.
  4. Make the relevant group footer visible.
  5. Add a text box to the group footer.
  6. Set its Control Source to =Sum([FeePaid]).
  7. Save and preview the report.

The total is calculated separately for each group when the text box is placed in the appropriate group footer.

6. Counting Records in a Report

The Count function is useful when you want to display the number of students, employees, orders, or other records.

Example Expression
=Count([StudentID])

This counts non-null StudentID values in the applicable report or group scope.

Steps
  1. Open the report in Design View.
  2. Add a text box to the Report Footer or relevant Group Footer.
  3. Set the Control Source to =Count([StudentID]).
  4. Add a suitable label, such as Total Students.
  5. Save and preview the report.
If StudentID is a primary key, it should normally contain a value for every record. Count on that field can therefore be used to count the included students.

7. Calculating Average, Maximum, and Minimum

You can use aggregate functions to calculate other useful summary values in a report.

Average
=Avg([Marks])

Calculates the average of the non-null Marks values in the applicable scope.

Maximum
=Max([FeePaid])

Finds the highest FeePaid value.

Minimum
=Min([FeePaid])

Finds the lowest FeePaid value.

These expressions require the referenced fields to exist in the report's record source. Use suitable numeric fields for numerical calculations.

8. Using Report Totals with Grouping

Grouping and aggregate functions can be combined to create detailed summaries.

Example: Course-Wise Student Count
  1. Create a report using student data.
  2. Group records by Course.
  3. Open the report in Design View.
  4. Display the relevant group footer.
  5. Add a text box to the group footer.
  6. Set the Control Source to =Count([StudentID]).
  7. Label the control Students in Course.
  8. Save and preview the report.
Example Output
Course Student Count Total Fee Paid
ADCA 2 ₹8,000
Tally Prime 1 ₹4,000
Grand Total 3 ₹12,000

These values are illustrative and based on the sample records shown in this lesson.

9. Formatting Report Totals

Formatting helps users identify totals quickly. You can format total controls in the same way as other report controls.

Recommended Formatting
  • Use bold text for grand totals.
  • Give total labels meaningful names.
  • Use suitable number or currency formatting.
  • Align totals with the corresponding numeric fields.
  • Keep group totals and grand totals visually distinct.
Steps
  1. Open the report in Design View or Layout View.
  2. Select the text box displaying the total.
  3. Open the Format tab or Property Sheet.
  4. Adjust font, alignment, and number formatting.
  5. Save and review the report in Print Preview.
Best Practice: Apply currency formatting to fee totals when the field represents money.

10. Common Problems with Report Totals

Problem 1: Total Displays #Error

Possible solution: Check the field name, Control Source expression, and report's record source.

Problem 2: Total Is Incorrect

Possible solution: Check which records are included in the report and whether the total control is placed in the correct report or group section.

Problem 3: Count Is Lower Than Expected

Possible solution: Count ignores null values in the specified field. If necessary, use a field that contains a value for every record, such as a primary key.

Problem 4: Total Is Blank

Possible solution: Verify that the report contains records and that the source field contains suitable values.

Problem 5: Group Totals Repeat Incorrectly

Possible solution: Check the grouping configuration and ensure the total control is in the intended Group Footer rather than an unrelated section.

11. Practical Assignment

Create a student fee report that displays individual payments, course-wise totals, and a grand total.

Required Fields
  • StudentID
  • StudentName
  • Course
  • FeePaid
Tasks
  1. Create or open a table containing student fee data.
  2. Create a report named rptFeeSummary.
  3. Group the report by Course.
  4. Display the total fee paid for each course.
  5. Count the students in each course.
  6. Display the grand total in the Report Footer.
  7. Format all monetary values as currency.
  8. Save and preview the report.
Goal: Create a report that summarizes fees and student counts by course and across the entire report.

12. Revision Questions

  1. What are report totals in MS Access?
  2. Which function calculates the sum of numeric values?
  3. What is the purpose of the Count function?
  4. Which function calculates an average?
  5. What is the difference between group totals and grand totals?
  6. Where can you place a grand total control?
  7. How do you calculate total fees using a text box?
  8. Why is a primary key useful when counting records?
  9. How can you display totals as currency?
  10. What should you check if a total displays an error?

🧠 Quick Quiz

1. Which function calculates the sum of numeric values?




2. Which function counts non-null values in a field?




3. Where is a grand total commonly placed?