A FileMaker enthusiast at the 2008 FileMaker Developer Conference asked me if it's possible to create a summary field in the footer part that would summarize the records just from the current page. I immediately asked him if he was using sliding objects on the layout. If there is the same number of records on every page, there are several easy approaches. Unfortunately, he answered "yes," and I was about to begin a quest that lasted a week after the conference was over.
My next thought was, this would be fairly easy with a script but would require modifying multiple records, which could cause record-locking in a multi-user environment. No, I needed a calculation that would change depending on the page that was displaying in preview mode or outputting from a printer. So, I racked my head for several hours, starting with simple approaches like a subsummary sorted by a calculation field containing the following formula:
Get(PageNumber)
I figured I could use a trailing subsummary part instead of a footer, but get the same results since the subsummary part would break at the end of each page. Unfortunately, the Get(PageNumber) function evaluates as each page is being previewed or printed. It took me a while to figure this out, and I was only able to once I employed the Data Viewer. Using the GetNthRecord function, I looked at the page number calculation field on pages other than the current page. To my dismay, the calculation always showed the current page number no matter what page it was on.
I attempted many more simple yet obscure approaches to solve the problem but none of them worked. I was getting frustrated enough to ask for help so I talked to a few developers. Most hadn't tried to total a value by page, and the ones who had tried had employed a script.