I have a report that is way too long because it prints subtotals even when there is only one detail record. Is there a way to suppress the subtotal if there is only one detail AND to not leave a space for the subtotal if it is suppressed.
I have a report that is way too long because it prints subtotals even when there is only one detail record. Is there a way to suppress the subtotal if there is only one detail AND to not leave a space for the subtotal if it is suppressed.
Put a record counter control in the detail section of the report.
On the OnFormat event of the footer or group where the subtotal is printed, test that record counter. If 1, set the subtotal control "Visible" property to No, otherwise, set it to Yes.
I loved your idea but I can't get it to work. Any thoughts on formatting? Here's what I typed in where "ct" is the counter and "amt" is the field I am subtotaling.
=IIf([ct]>1,Sum([Amt].[Visible])=True,Sum([Amt].[Visible])=False)
Think about what you did, you summed a visible property. You weren't even close.
Use in the report footer Onformat event
Substitute the real count detail section control name for "cnt" and the real footer total control name for "amt".Code:
if me.cnt > 1 then
me.amt.visible = true
else
me.amt.visible = false
end if