T
Treebeard
Very strange problem I just ran into.
I have a report which is a basic "products sold" report for a specified
period of time.
There is ProductID, Price, Qty ; this is very simple.
Now the users wants a line for every product at every price the product was
sold at , and if it were sold at more than one price, a summation line for
that product, for example:
ProductID PRICE QTY
102 $2.00 4
--------------------------
134 $3.00 6
------------------------
185 $2.50 3
185 $2.75 4
-----
7
---------------------
198 $4.87 6
----------------------
234 $5.34 2
----------------------
345 $9.34 7
----------------------
234 $5.65 34
----------------------
etc
etc
Ok, I thought I had it and everything looked good, except , all of a sudden,
the "Number of Pages " is off!
The report is 16 pages, and on the first page it says "Page 1 of 13" ; on
the 2nd page "Page 2 of 13" and so on, until it say "Page 13 of 13 ", then
"14 of 13" then "15 of 13" and finally on the last page "16 of 13".
I have the standard ="Page " & [Page] & " of " & [Pages]
in the page footer
I should explain how I'm using a summary line only for those products which
were sold at more than one price. Basically I'm making the GroupFooter
invisible if I see that there is only one price for a product.
In the report code I'm defining the following variables:
strProductID As String
bolMultiplePrices As Boolean
In the DETAIL_PRINT i have this:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' check to see if this is the same
' as the last Product
'
If strProductID = Me.ProductID Then
bolMultiplePrices = True
Else
bolMultiplePrices = False
End If
strProductID = Me.ProductID
End Sub
***************
Then in the group footer :
Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
If bolMultiplePrices Then
Me.GroupFooter0.Visible = True
Else
Me.GroupFooter0.Visible = False
End If
End Sub
*************************
If I remove the GroupFooter code everything works fine and the page count is
correct, however every product prints out with a summary line , which puts
an extra 40% of pages onto the report. It looks something like this:
ProductID PRICE QTY
102 $2.00 4
-----
4
--------------------------
134 $3.00 6
-----
6
------------------------
185 $2.50 3
185 $2.75 4
-----
7
---------------------
198 $4.87 6
-----
6
----------------------
234 $5.34 2
-----
2
----------------------
345 $9.34 7
-----
7
----------------------
234 $5.65 34
-----
34
----------------------
etc
etc
Any suggestions? I hope I made myself clear.
Jack
I have a report which is a basic "products sold" report for a specified
period of time.
There is ProductID, Price, Qty ; this is very simple.
Now the users wants a line for every product at every price the product was
sold at , and if it were sold at more than one price, a summation line for
that product, for example:
ProductID PRICE QTY
102 $2.00 4
--------------------------
134 $3.00 6
------------------------
185 $2.50 3
185 $2.75 4
-----
7
---------------------
198 $4.87 6
----------------------
234 $5.34 2
----------------------
345 $9.34 7
----------------------
234 $5.65 34
----------------------
etc
etc
Ok, I thought I had it and everything looked good, except , all of a sudden,
the "Number of Pages " is off!
The report is 16 pages, and on the first page it says "Page 1 of 13" ; on
the 2nd page "Page 2 of 13" and so on, until it say "Page 13 of 13 ", then
"14 of 13" then "15 of 13" and finally on the last page "16 of 13".
I have the standard ="Page " & [Page] & " of " & [Pages]
in the page footer
I should explain how I'm using a summary line only for those products which
were sold at more than one price. Basically I'm making the GroupFooter
invisible if I see that there is only one price for a product.
In the report code I'm defining the following variables:
strProductID As String
bolMultiplePrices As Boolean
In the DETAIL_PRINT i have this:
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' check to see if this is the same
' as the last Product
'
If strProductID = Me.ProductID Then
bolMultiplePrices = True
Else
bolMultiplePrices = False
End If
strProductID = Me.ProductID
End Sub
***************
Then in the group footer :
Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
If bolMultiplePrices Then
Me.GroupFooter0.Visible = True
Else
Me.GroupFooter0.Visible = False
End If
End Sub
*************************
If I remove the GroupFooter code everything works fine and the page count is
correct, however every product prints out with a summary line , which puts
an extra 40% of pages onto the report. It looks something like this:
ProductID PRICE QTY
102 $2.00 4
-----
4
--------------------------
134 $3.00 6
-----
6
------------------------
185 $2.50 3
185 $2.75 4
-----
7
---------------------
198 $4.87 6
-----
6
----------------------
234 $5.34 2
-----
2
----------------------
345 $9.34 7
-----
7
----------------------
234 $5.65 34
-----
34
----------------------
etc
etc
Any suggestions? I hope I made myself clear.
Jack