Sorry, I don't think I made myself clear. The example I am looking for, would be one that prints a report on pre-printed forms, not one that demonstrates the use of a variable. For instance, using a report header, a fixed height detail band and a report footer that is fixed to the bottom of the page.
In this instance, I have a pre-printed invoice form. In the HEADER will go the customer name, address, invoice number & date. In the DETAIL section I will list the items that were purchased. On each line will be an "item" which consists of the number of the UPC code that was scanned, a description of the item, the unit price, the quantity purchased, and the extended price (quantity * unit price). The form has room for about twenty single spaced items. In the REPORT FOOTER I must print the sub-total, tax, etc. in little boxes printed on the form. So I must control the detail section so that I go to a new page without totaling, every time I print 20 items in the detail band and still have more items to print.
In order to control the number of lines in the detail section, I want to use a numberVar in the “Page Break before” section of the detail band as a counter. I will increment the counter, every time I make a pass through the detail section, but if I understand you correctly, this won’t work, because I will evaluate all the code with every pass, which will cause the counter variable to be re-declared (even if it was declared globally and already exists) and that will reset the counter to zero. Doubtless, I am missing something here and rather than experiment and find something that usually works, until my customer tries it (whereupon it will immediately break) I thought perhaps someone could suggest an approach that they know will work. Feel free to assume I am dense and show me what code I need and where to put it to make this work.
Thank you for your patience.
Phil