Conditionally suppress footer

Posted on 2005-04-15
Last Modified: 2008-03-04
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?

Question by:James_Card
    1 Comment
    LVL 65

    Accepted Solution

    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
        Me.ReportFooterSection.Visible = False
    End If
    End Sub

    Hope this helps.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    This isn't a frequent question on EE. I must have seen it three or four times (among several thousand questions). However, I use this trick quite often, most frequently as a delayed Current event. A form does not expose it's calculation dependenc…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now