NewPage

Hello, I have not been using the report properties grouping but want to throw a page when a field changes value, at the moment when this field changes value it prints the header but not on a new page. Can you suggest suitable code I can place in the OnPresection that will copy record and compare with next record and if change then NewPage. Many Thanks

I didn’t test this code, but that should do the trick… **OnPreReport()** LastFieldValue := 'INIT'; // same variable type as your field **OnPreSection()** IF MyRecord.MyCurrentField <> LastFieldValue THEN BEGIN //change CurrReport.NEWPAGE; LastFieldValue := MyRecord.MyCurrentField; END; Another option would be to group on this field and to create a new page every time the group header is printed.