dbMark,
You're right on the totals issue, they would also have to be calc'ed in the UDF. I was just trying to show a simple example or how to get around the page limitation issue.
You could use some report variables or whatever and keep your own running totals.
Somehow this line doesn't look right:
REPORT FORM MyReport NEXT 1000
Actually, you're right. It should read:
REPORT FORM MyReport NEXT 1000
TO PRINT
But I don't really know why you would need this statement:
lPageForm <= lMaxPages
Unless you are trying to limit the total number of pages printed.
What happens in the DO WHILE ... loop, is that the report will get called as long as the record pointer isn't at EOF(). The record pointer will move through the first 1000 records printing them, then it stays put until the next iteration of the loop. It will then print until either another 1000 records has printed or it reaches EOF().
The gotcha I didn't include here, is that it starts with the current record, and prints 1000 more. So a SKIP needed to be included or the last page of the previously printed 1000 will be the same as the first page of the next 1000. Hopefully that is not too confusing.
Here is what it should look like:
Code:
STORE 0 TO lPageCount
DO WHILE !EOF()
REPORT FORM MyReport NEXT 1000 TO PRINT
SKIP
ENDDO
FUNCTION MyPageNo
lPageCount = lPageCount + 1
RETURN lPageCount
-Dave S.-
![[cheers] [cheers] [cheers]](/data/assets/smilies/cheers.gif)
Even more Fox stuff at: