A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Group Count in Parent Group Header



 
 
Thread Tools Display Modes
  #1  
Old December 22nd, 2009, 06:41 PM posted to microsoft.public.access.reports
hadi
external usenet poster
 
Posts: 44
Default Group Count in Parent Group Header

Hello Experts,

I know this has been asked several times on this forum. I have two groupings
in my the report. i want the Header of the first grouping to show the count
of records in the second groupings. I'm familiar with the trick where you
create a text box, set it to 1, set running sum to over group etc. This works
except i want to show the totals in the Header of the Group not the Footer.

Thanks

Hadi
  #2  
Old December 22nd, 2009, 07:49 PM posted to microsoft.public.access.reports
Dale Fye
external usenet poster
 
Posts: 2,651
Default Group Count in Parent Group Header

A couple of possible solutions.

1. Create a query that groups by the same field used in the first group and
Counts the # of elements in the second group for each

SELECT [Group1Field], Count([Group2Field]) as CountOfGroup2
FROM your Table
GROUP BY [Group1Field]

Then add this query into the query which the report is based upon, joining
it on the Group1Field. If you do this, you could just add a control for
CountOfGroup2 to your main forms Group#1 header.

2. An alternative would be to create an unbound textbox and use the DCOUNT(
) function to count the number of records that match the Group1 header.
Place the DCOUNT( ) function in the textboxes control source, like:

Control Source: =DCOUNT("SomeField", "SomeTableOrQuery", "[Group1Field] = "
& me.txtGroup1Field)

3. You could also use the FORMAT event of the Group#1 header to fill in a
textbox similar to option #2.

----
HTH
Dale



"Hadi" wrote:

Hello Experts,

I know this has been asked several times on this forum. I have two groupings
in my the report. i want the Header of the first grouping to show the count
of records in the second groupings. I'm familiar with the trick where you
create a text box, set it to 1, set running sum to over group etc. This works
except i want to show the totals in the Header of the Group not the Footer.

Thanks

Hadi

  #3  
Old December 22nd, 2009, 07:49 PM posted to microsoft.public.access.reports
Clifford Bass via AccessMonster.com
external usenet poster
 
Posts: 150
Default Group Count in Parent Group Header

Hi Hadi,

Have you tried just using =Count(*) as the Data Source of the text box
in the first grouping? Or am I missing something about what you are trying
to do? If so, please expand, maybe with an example.

Clifford Bass

Hadi wrote:
Hello Experts,

I know this has been asked several times on this forum. I have two groupings
in my the report. i want the Header of the first grouping to show the count
of records in the second groupings. I'm familiar with the trick where you
create a text box, set it to 1, set running sum to over group etc. This works
except i want to show the totals in the Header of the Group not the Footer.

Thanks

Hadi


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ports/200912/1

  #4  
Old December 22nd, 2009, 08:41 PM posted to microsoft.public.access.reports
hadi
external usenet poster
 
Posts: 44
Default Group Count in Parent Group Header

Hi Clifford,

using the count(*) will count all of the records under the details section
which i really do not need

Hadi


"Clifford Bass via AccessMonster.com" wrote:

Hi Hadi,

Have you tried just using =Count(*) as the Data Source of the text box
in the first grouping? Or am I missing something about what you are trying
to do? If so, please expand, maybe with an example.

Clifford Bass

Hadi wrote:
Hello Experts,

I know this has been asked several times on this forum. I have two groupings
in my the report. i want the Header of the first grouping to show the count
of records in the second groupings. I'm familiar with the trick where you
create a text box, set it to 1, set running sum to over group etc. This works
except i want to show the totals in the Header of the Group not the Footer.

Thanks

Hadi


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ports/200912/1

.

  #5  
Old December 22nd, 2009, 09:58 PM posted to microsoft.public.access.reports
Clifford Bass via AccessMonster.com
external usenet poster
 
Posts: 150
Default Group Count in Parent Group Header

Hi Hadi,

If Dale's solution does not help... I am clearly confused as to your
goal. What precisely are you counting? The number of groups? Again, an
actual small example would help.

Clifford Bass

Hadi wrote:
Hi Clifford,

using the count(*) will count all of the records under the details section
which i really do not need

Hadi


--
Message posted via http://www.accessmonster.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:56 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.