Microsoft Access VBA Macro Programming

(Tina Sui) #1

This expression concatenates text and field names and functions to produce a single text
statement for use on the report. For example, [Ship Name] is a field name within the Record
Source, and the function Count(*) will provide the number of records in the section. The IIf
function is used to differentiate between “detail record” for one record and “detail records”
for several.
Delete the corresponding label since it is not needed in this case.
View your report in Report View mode. It should now look like Figure 9-10.
Your text boxes with formulas in them now display details for each Ship Name in the
report.
You have probably noticed it is quite a time-consuming job adding in new sections of the
report and adding in formulas. This is why it is a very good idea to let the Report Wizard do
the initial hard work in creating your report, and then afterward you can customize it.


Using a Custom Ribbon on the Report

When you design a report, it always looks like you are stuck with the standard Access ribbon
when it is displayed, but this is far from the case. See Chapter 11 on how to design custom


Chapter 9: Forms and Reports 119


Figure 9-10 Utilizing formulas with your report

Free download pdf