Robin Lawrence
rgilimited at btconnect.com
Thu Jun 3 04:50:07 CDT 2004
Andy, Thanks for your reply. I'm printing delivery advices which need to be produced for each 3 units in an order. (Has an address label on and each box can only take 3 units) The [Qty] for each Order Line can be any number (even > 3 ) and I need to be able to step through each line separately to handle this. I think I need to get the page break working first, then work out how to handle the (>3) problem. I don't think this can be done within a preset Page Break? Any thoughts welcome Rgds Robin -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Andy Lacey Sent: 03 June 2004 09:47 To: Access Developers discussion and problem solving Subject: Re: [AccessD] Conditional Page Break from Subreport revisited 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 -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com