none
surpress group footer RRS feed

  • Question

  • I would like to surpress group footer invisble when the detail row only one record and display footer when the detail row has more than one row.

    Are there any suggetions for this?

    Your help and information is great appreciated,

    Regards,

    Sourises

    Wednesday, April 11, 2018 7:29 PM

Answers

  • Hi,

    One trick you might try is to add a hidden textbox in the detail section and set the Control Source to =1. Then, set the Running Sum property to Over Group. You can then try to use it for counting the rows in the Footer section.

    Hope it works...

    Wednesday, April 11, 2018 8:14 PM
  • ...............I want to count the record count of detail row, not whole report.

    Add a text box to the group footer with a ControlSource property of:

        =Count(*)

    To suppress the footer where the count of rows for the group is 1, in the group footer's Format event procedure put:

        Cancel = (Me.[NameOfTextBoxGoesHere] = 1)

    If you are unfamiliar with entering code into a form's, report's, report section's  or control's event procedures, this is how it's done in form or report design view:

    1.  Select the form, report, section or control as appropriate and open its properties sheet if it's not already open.

    2.  Select the relevant event property and select the 'build' button (the one on the right with 3 dots).

    3.  Select Code Builder in the dialogue and click OK.  This step won't be necessary if you've set up Access to use event procedures by default.

    4.  The VBA editor window will open at the event procedure with the first and last lines already in place.  Enter or paste in the code as new line(s) between these.


    Ken Sheridan, Stafford, England

    Wednesday, April 11, 2018 9:13 PM

All replies

  • Hi,

    I don't have any database to test right now but see if there's a Format event in the Footer section. If so, you could try using it to count the rows and then act accordingly (hide or show the footer).

    Hope it helps...

    Wednesday, April 11, 2018 8:05 PM
  • Thanks for helping,

    Yes, it helps, because I want to count the record count of detail row, not whole report.

    Are there any property to read from report or I need to run a query against database to get current record count for this dtail group?

    Thanks again for helping,

    Regards,

    Sourises,

    Wednesday, April 11, 2018 8:10 PM
  • Hi,

    One trick you might try is to add a hidden textbox in the detail section and set the Control Source to =1. Then, set the Running Sum property to Over Group. You can then try to use it for counting the rows in the Footer section.

    Hope it works...

    Wednesday, April 11, 2018 8:14 PM
  • ...............I want to count the record count of detail row, not whole report.

    Add a text box to the group footer with a ControlSource property of:

        =Count(*)

    To suppress the footer where the count of rows for the group is 1, in the group footer's Format event procedure put:

        Cancel = (Me.[NameOfTextBoxGoesHere] = 1)

    If you are unfamiliar with entering code into a form's, report's, report section's  or control's event procedures, this is how it's done in form or report design view:

    1.  Select the form, report, section or control as appropriate and open its properties sheet if it's not already open.

    2.  Select the relevant event property and select the 'build' button (the one on the right with 3 dots).

    3.  Select Code Builder in the dialogue and click OK.  This step won't be necessary if you've set up Access to use event procedures by default.

    4.  The VBA editor window will open at the event procedure with the first and last lines already in place.  Enter or paste in the code as new line(s) between these.


    Ken Sheridan, Stafford, England

    Wednesday, April 11, 2018 9:13 PM
  • Thanks a million for the information and helping ,

    Sourises,

    Thursday, April 12, 2018 4:16 PM
  • Thanks a million for the information and help,

    Regards,

    Sourises,

    Thursday, April 12, 2018 4:16 PM
  • Hi,

    It's always good to see the different solutions possible with Access. Glad we could assist. Good luck with your project.

    Thursday, April 12, 2018 4:29 PM