Results 1 to 4 of 4
  1. #1
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72

    How to conditionally hide report group footer?

    I have an invoice report with a group footer based on a "company name" grouping. Under some circumstances I want to print the report with this group footer hidden. How can I conditionally hide the group footer from within the calling VBA?

    e.g. Here I want to show the footer:

    DoCmd.OpenReport "CollectionInvoices", acViewPreview, , "Company = '" & _
    Me.CompanyNameText & "' And InvoiceDate >= #" & Me.StartDateText & _
    "# And InvoiceDate <= #" & Me.EndDateText & "#"



    ... and here I want to hide the footer:

    DoCmd.OpenReport "CollectionInvoices", acViewPreview, , "InvoiceNo = '" & Me.InvoiceNo & "'"

    The only way I can think to do this, is by using two different reports: one with the footer and the other without. Is there a better way?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You don't need two reports. You can use the OpenArgs argument of OpenReport to send a value to the report. In the open event of the report, test that value and hide/show the footer as appropriate.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    degras is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    72
    Thanks, that worked fine.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 01-13-2011, 03:53 AM
  2. Calculation in a group footer.
    By stupesek in forum Reports
    Replies: 11
    Last Post: 09-29-2010, 07:30 AM
  3. Conditionally hide detail row in report
    By martinjamesward in forum Reports
    Replies: 5
    Last Post: 09-06-2010, 02:51 AM
  4. Trouble Summarizing in Group Footer
    By Millerguitarworks in forum Reports
    Replies: 2
    Last Post: 12-07-2009, 06:06 AM
  5. Totaling a value in group footer...
    By hodgy20 in forum Reports
    Replies: 0
    Last Post: 11-14-2008, 08:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums