Access 2010 report - detail format event over page break
I have an access 2010 report. On the detail format event I collect some totals. The totals weren't quite right so I added some debug.print statements to track what was happening. It seems that when the detail section goes over a page the detail line at the top of the second page is formatted twice. ie. the detail-format event is triggered twice so that amount is added to the total twice.
The code in the detail_Format event is something like: TotalAmt - TotalAmt + ThisAmt
So, TotalAmt is always equal to what it should be plus the 2nd page first item added in again. If I change where the page break happens the total changes accordingly.
Is this a bug? Any ideas how to fix this? I know I can use sum([field]) to total the detail section automatically but I want to do other things with the totals I collect.