Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SubTotals in reports

Status
Not open for further replies.

dawnd3

Instructor
Jul 1, 2001
1,153
US
this seems like a very easy thing to do, but I am having issues. I am trying to subtotal a report at the bottom of each page. So if the report goes to more than one page, the sub total will appear. I have a grand total at the end of the report in the group footer, which is working. In the page footer I put the exact same calculted control
=Sum([curUnitPrice]*[numqty])
but I get an error. Is there something I am missing? I can send a copy of the report if necessary. Thanks Dawn
 
Your problem is one of grouping and paging, not of syntax. A Page footer isn't smart enough to know what's "above" it, physically. (A report footer is - EVERYTHING is above it...)

Your best bet is to GROUP your details, and advance to a new page for each group, and then you can place a subtotal in the Group FOOTER section, which is much smarter than a page footer.

 
That is what I thought your answer might be. :) But here is the problem. The client wants it to subtotal at the bottom of each page. There isn't any way to group it that it would make sense. To explain further, it is a purchase order that sometimes can be one page long or more depending on the items. Let me know if you think there is any other options. If not, I will tell them that they will need to subtotal by a field and not at the bottom of each page. Thank you for your help. Dawn
 
shouldn't there be a way to do this in VBA? I don't know VBA very well but I am imagining that on the "OnPrint" event I can put in code to figure out what is on Page 1, Page 2, etc and calculate and put in the footer. Any VBA experts, please step up :)

Dawn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top