How suppress sum of detail in footer when only one detail line

  • Thread starter Thread starter mscertified
  • Start date Start date
M

mscertified

I have a detail section and a footer section that prints the sum of the
detail lines. I'd like to suppress the footer when there is only one detail
line. How?
 
Try add a text box to the group footer section:
Name: txtCountGroup
Control Source: =Count(*)
Visible: No
Then add code in the module window to the On Format event of this group
footer:
Cancel = Me.txtCountGroup = 1
 
Add a control to the detail line
Name the control: HowMany
Set its source to =1
Set its running sum to OverGroup

In the format event of the group, enter code like

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
Cancel = (Me.HowMany= 1)
End Sub


--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top