Dynamic Reports

P

Pauline Huser

I was able to create a dynamic report and get a total at the bottom of the
report but need a grouping total, I pasted the Report Footer code to the
Group Footer but it's doing a running total, just need a little help to
change the code to only total up the Group

This is the code for the GroupFooter that is doing a running total

' Variables for number of columns and row and report totals.
Dim intColumnCount As Integer
Dim lngRgColumnTotal(1 To conTotalColumns) As Long
Dim lngReportTotal As Long

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)

Dim intX As Integer

' Put column totals in text boxes in report footer.
' Start at column 2 (first text box with crosstab value).
For intX = 2 To intColumnCount
Me("GTot" + Format(intX)) = lngRgColumnTotal(intX)
Next intX

' Put grand total in text box in report footer.
Me("GTot" + Format(intColumnCount + 1)) = lngReportTotal

' Hide unused text boxes in report footer.
For intX = intColumnCount + 2 To conTotalColumns
Me("GTot" + Format(intX)).Visible = False
Next intX

End Sub

Thanks for all the help
 
P

phuser

You are exactly right it is from a crosstab query, the solution you
presented is in a completely different format (very good) but not what I
need, I need the VBA code below altered so it will not be a running total. I
dont know how to on my own :-(
 
D

Duane Hookom

I don't see anything in the code that sums anything. I don't care for that
particular solution because it is inefficient and requires so much coding. It
is also a bit inflexible.
 
P

phuser

' Initialize array that stores column totals.
For intX = 1 To conTotalColumns
lngRgColumnTotal(intX) = 0
Next intX

???
 
D

Duane Hookom

There is no summing in that section of code. It looks like the values are all
set back to 0 which I assume is what you need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top