Right click on the detail section in the design window and select format section. To the right of "new page after" is a button labeled "X-2". All "X-2' buttons are for conditional formmatting. Enter the following formula in there: Remainder(RecordNumber,40)=0
This will cause a Page break if the record number is perfectly divible by 40. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office