[AccessD] Conditional Page Break from Subreport revisited

Andy Lacey andy at minstersystems.co.uk
Thu Jun 3 03:47:11 CDT 2004


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.

--
Andy Lacey
http://www.minstersystems.co.uk



--------- Original Message --------
From: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
To: AccessD at databaseadvisors.com <AccessD at databaseadvisors.com>
Subject: [AccessD] Conditional Page Break from Subreport revisited
Date: 03/06/04 08:19

>
> Have done some further work on this since yesterday's post - revised
> questions below.
> Would appreciate any pointers anyone can give me ...
>
> I have a standard type report based on Order / Order Line tables  with
> Order Report [WHD_Ord] and Order Line Subreport [WHD_Line_Sub] - no
> sorting or grouping in either report.
>
> I need to force a new page whenever the sum of [Qty] field in
> [WHD_Line_Sub] >= 3 .
> (ie no more than 3 items allowed per page)
>
> I have got so far:
> Add Text box in [WHD_Line_Sub]
> Name = RunSum
> Control Source = [Qty]
> Running Sum = Over All
>
> Add PageBreak [WHDL_PBreak] in detail section of [WHD_Line_Sub]
>
> Add to Page Header of [WHD_Ord]
> Private Sub PageHeader_Format(Cancel As Integer, FormatCount As Integer)
> Reports![WHD_Orders]![WHD_Line_Sub].Report![WHDL_PBreak].Visible = False
> End Sub
>
> Add to Detail - On Format of [WHD_Line_Sub]
> Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
> If FormatCount = 1 Then
>     If y = Empty Then y = 3
>     x = Me.RunSum
>     If y Mod x = 0 And x > 1 Then
>         MsgBox ("Force New Page" & " " &
Me.RunSum & " " & Me.Title)
>         Me.WHDL_PBreak.Visible = True
>     End If
> End If
> End Sub
>
> 1- Should the page break be in the subreport detail section or main
> report detail section ? -  as set out above  no page break is occuring .
> 2 -The Detail - On Format section of code in the subreport runs through
> twice even though I've checked the FormatCount property - why is this?
>
> Regards
> Robin Lawrence
> robin at rolledgold.co.uk
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
>
>
>

________________________________________________
Message sent using UebiMiau 2.7.2




More information about the AccessD mailing list