CotoJoe said:
I tried this but it didn't work. Forgive me I am new to Access. I have a
main report named rptInvoice with 2 subforms, rptFloaterTrans and
rptTaxesSumProp. In the HasData section of the sub-form (not the main form
property), I typed
IIf(subreport.rptFloaterTrans.HasData, subreport.rptFloaterTrans.textbox,
0). After I exited the expression it put [] around the words "subreport" and
[rptFloaterTrans.HasData] .
Am I typing this in the right place the right way? Should I put the
expression on the main report property HasData section?
There is no such thing as a HasData section so I have no
idea what you are referring to. The place to put the
expression is in a main report text box's ControlSource
property.
You seem to have misunderstood what you need to replace with
your own names. The text box's expression would be
=IIf(rptFloaterTrans.REPORT.HasData,
rptFloaterTrans.REPORT.textboxinrptFloaterTrans, 0) +
IIf(rptTaxesSumProp.REPORT.HasData,
rptTaxesSumProp.REPORT.textboxinrptTaxesSumProp, 0)
Note that the subreport names used here are the names of the
subreport **controls** on the main report. These names may
be different from the name of the report object they are
displaying.