Results 1 to 10 of 10
  1. #1
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Count GroupHeader lines (97SR2)

    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.
    Regards,
    Rory

    Microsoft MVP - Excel

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Count GroupHeader lines (97SR2)

    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?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count GroupHeader lines (97SR2)

    Rory,

    Right on the money! Nice shooting.

    Many thanks.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count GroupHeader lines (97SR2)

    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?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Count GroupHeader lines (97SR2)

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

    Microsoft MVP - Excel

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count GroupHeader lines (97SR2)

    Kevin,

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

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count GroupHeader lines (97SR2)

    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.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count GroupHeader lines (97SR2)

    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).
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  9. #9
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Count GroupHeader lines (97SR2)

    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. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

  10. #10
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Count GroupHeader lines (97SR2)

    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.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •