Footers

D

Dave Evans

In Sorting and Grouping I have a footer on one of my fields.

However I only want the footer to print if it groups on more than one value

i.e. if the field groups on one value only i do not want the footer to be
shown

any ideas? some code in the on format property?
 
A

Allen Browne

Add a text box to the Detail section of your report, and give it these
properties:
Name txtCount
ControlSource =1
RunningSum Over Group
Format General Number
Visible No

Now in the Format event procedure of your group footer section, you either
set the PrintSection and MoveLayout properties of the report, or set the
section's Visible property to No.
Dim bShow As boolean
bShow = (Me.txtCount > 1)
Me.PrintSection = bShow
Me.MoveLayout = bShow

The running sum gives you the count so you know if you have more than one
record.
 
Top