Report Summary

  • Thread starter Thread starter Newbie
  • Start date Start date
N

Newbie

I have a report that is grouped on
Branch (2) and Products (2)
Totals are placed within the report but I would like to have a summary page
at the end that details the totals like so

Branch A Product A -
Branch A Product B
Branch B Product A
Branch B Product B

with all the totals that are scattered about the report

How can I achieve this?
 
Newbie said:
I have a report that is grouped on
Branch (2) and Products (2)
Totals are placed within the report but I would like to have a summary page
at the end that details the totals like so

Branch A Product A -
Branch A Product B
Branch B Product A
Branch B Product B

with all the totals that are scattered about the report

I think this should be done using a simple subreport based
on a Totals query that precalculates the values for the
subreport.
 
Thanks - I have done that but at runtime the main report can have a filter
set based on an option on the form from which it was run

How can I make the subreport use the same filter?
 
Newbie said:
Thanks - I have done that but at runtime the main report can have a filter
set based on an option on the form from which it was run

How can I make the subreport use the same filter?

Depends on how you're applying the filter??

In cases like this, I place the criteria values in hidden(?)
text boxes on the form and refer to them in the Where clause
of both record source queries.
--
Marsh
MVP [MS Access]


 
strFilter = string
bolFilterOn = true or false
I use me.Filter = strFilter and me.FilterOn = bolFilterOn


Marshall Barton said:
Newbie said:
Thanks - I have done that but at runtime the main report can have a filter
set based on an option on the form from which it was run

How can I make the subreport use the same filter?

Depends on how you're applying the filter??

In cases like this, I place the criteria values in hidden(?)
text boxes on the form and refer to them in the Where clause
of both record source queries.
--
Marsh
MVP [MS Access]


 
Since the subreport would be based on a Totals query, you
can't just apply a filter its results. Once you get an
unfiltered Totals query working, I think you can set the
subreport's record source property in the subreport's Open
event using code along these lines (general outline air
code):

Sub Report_Open(
Static Initialized As Boolean
DIm strSQL As String
Dim strFilter
Dim bolFilterOn

If Not Initialized Then
Initialized = True

' copy of whatever code you have in the main report
' to assign values to strFilter and bolFilterOn

' Place the Totals query's SQL in a string variable
strSQL = "SELECT . . ."
' Apply the filter to the query
If bolFilterOn Then
strSQL = strSQL & " WHERE " & strFilter
End If

Me.RecordSource = strSQL
End If

Personally, I don't like using the Filter property - period.
So I continue to urge you to use parameter queries in this
situation.
 
Back
Top