• Count GroupHeader lines (97SR2)

    Author
    Topic
    #363783

    Hi Kevin,
    If I understand you correctly then I think this will do what you need:
    Put a textbox in the group header with a controlsource of =1 and RunningSum set to OverGroup. You can set its visible property to False if you don’t want a running total shown in the report. Then in the report footer add a textbox with a controlsource of =textbox1 (where textbox1 is the name of the running sum textbox). This will then give you a count of how many Group Headers there were.
    Hope that helps.

    Viewing 2 reply threads
    Author
    Replies
    • #556216

      How do I count the number of lines in a group header?

      Using the Count() function on the table field, I get the number of rows returned from the query, not the number of unique values in the field (the report is grouped on this field).

      I need that total to appear in the report footer.

      Does that make sense?

    • #556220

      Rory,

      Right on the money! Nice shooting.

      Many thanks.

    • #556221

      Oh, one more thing. In design view, I set the visible property for the textbox in the groupheader to False, but I can’t move the detail band up to reduce the space used by the groupheader band. It stops so as to always display the textbox. Is there some trick to reducing the size of the groupheader display band?

      • #556222

        Try setting the height and top of the textbox to 0 and then resize the group header section and see if that helps.

        • #556290

          That’s an interesting trick, but the txtbox all but disappears. For now I’ve moved it into an inconspicuous place on the display line.

      • #556230

        Kevin,

        You can also set the Can Shrink property of the groupheader to True

        • #556299

          Hey Frank,

          I tried that but I still can’t slide the details band over the control. I’m used to Powerbuilder for SQL report writing which allows the report bands to be shrunk to any size no matter what controls are in the band. Access appears to only allow the band to shrink to a size that makes sure all controls are visible (even if the visible prop is set to false).

          • #556363

            No, it allows the band to shrink to a size that will accommodate the size of the controls, visible or not. Access doesn’t have any way to know whether you might decide to turn the control’s visibility back on in your code, so it doesn’t take any chances. shrug

            • #556564

              Thanks. That’s the definitive info I need. Now I can stop trying things and just live with it. I found that I can shrink the control to a small size (still visible to the naked eye) and cram it between two visible controls then slide the band up.

              All is well.

    Viewing 2 reply threads
    Reply To: Reply #556230 in Count GroupHeader lines (97SR2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information:




    Cancel