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.
James_CardAsked:
Who is Participating?
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.