[AccessD] Conditional Page Break from Subreport revisited

Stuart McLachlan stuart at lexacorp.com.pg
Thu Jun 3 06:03:41 CDT 2004


On 3 Jun 2004 at 9:47, Andy Lacey wrote:

> Robin
> Just coming at this from a different angle, do the order items have an item
> number (1,2...) within each order? Or could you construct one? If so you
> could solve the issue by having a calculated value in the query, such as
> Fix(([ItemNo]-1)/3). Then you can break on change of that and set the header
> section associated with that break to have a Page Break.
> 

If you have something like ItemNo which is NOT sequential, you can use a static 
function to build a breakpoint based on ItemNo or any other field in the query.

Static Function PageNumber(ItemNo as long) as long
dim counter as long
If ItemNo = -1 then counter =0
PageNumber = Fix(counter / 3)
counter = counter + 1
End Function

Immediately before you open the report (in the button click to show the 
report?), initialize sequence with 

ReturnVal  = PageNumber(-1)

Then group your report on =PageNumber(ItemNo) with a page break in the footer.

 
-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System Support.






More information about the AccessD mailing list