SubReports

  • Thread starter Thread starter Betty
  • Start date Start date
B

Betty

I am running Access 97. I have a main report and 3
subreports that form part of the main report. The grand
total of the main report is an addition formular which is
comprise of the results from the sub reports and also data
on the main report. For example: "sub1 + sub2 + main1 +
main2 = Grand total" The main report is run based on a
particular date. If sub2 doesn't have any data for that
particular date, It does not add sub1 + main1 + main 2.
the Grand total remains empty. To get around that problem
I have to enter a record with zero values for each date
into the respective tables. How can I get the Grand total
to calculate even if one of the components of the formular
does not have any data? Thank You.
 
Betty said:
I am running Access 97. I have a main report and 3
subreports that form part of the main report. The grand
total of the main report is an addition formular which is
comprise of the results from the sub reports and also data
on the main report. For example: "sub1 + sub2 + main1 +
main2 = Grand total" The main report is run based on a
particular date. If sub2 doesn't have any data for that
particular date, It does not add sub1 + main1 + main 2.
the Grand total remains empty. To get around that problem
I have to enter a record with zero values for each date
into the respective tables. How can I get the Grand total
to calculate even if one of the components of the formular
does not have any data?


Use this kind of expression:

=main1 + main2 + IIf(rptsub1.Report.HasData,
rptsub1.Report.sub1, 0) + IIf(rptsub2.Report.HasData,
rptsub2.Report.sub2, 0)
 
Back
Top