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

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?
 
D

Duane Hookom

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
 
J

John Spencer

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
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top