• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 326
  • Last Modified:

Conditionally suppress footer

I have a report with detail and footer section.  The footer section gives a subtotal for the detail.  I want to show this footer when there are more than one detail records and hide it when there is only one.  How do I do this?

Thanks,
James.
0
James_Card
Asked:
James_Card
1 Solution
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Create a textbox in the report (page?) (let's call it my_count) footer that has a ControlSource = Nz(Count([SomeValueInDetailSection]),0)

Then, use your footer's OnFormat event like this...

Private Sub ReportFooterSection_Format(Cancel As Integer, FormatCount As Integer)
if Me!my_count = 0 then
    Me.ReportFooterSection.Visible = True
Else
    Me.ReportFooterSection.Visible = False
End If
End Sub

Hope this helps.
-Jim
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now