[AccessD] Conditional Page Break from Subreport revisited

Robin Lawrence rgilimited at btconnect.com
Thu Jun 3 06:11:57 CDT 2004


Andy,
Thanks for that - will give it a go....
Being forced to look at the overall problem again I think I may have to
use DAO to preprocess the order lines into a temp table and base a query
on that - don't see how else I could handle eg [qty] = 6 for a single
item (3 + 3 carried forward)since it is only on one order line.
Have to leave it for now - got some meetings this afternoon :)
Will come back with a solution or more questions
Thks again
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 11:25
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Conditional Page Break from Subreport revisited


Ok, another idea. How about this?
1-Remove the Page Break control
2-Create a Sort Group, with a Group Header, based on your order line
level,
ie you'd have this print for every Detail line.
3-Set that Group Header to Force Page Break
4-In the OnFormat of that Group Header section test your Qty and Cancel
the
section if you don't need the break.

This is untested and off the top of my head. Just thinking of other ways
to
skin this cat. Oh and I've often found that you can't rely on
FormatCount/PrintCount, so it's best to find a method where it won't
matter
if poss.


--
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





More information about the AccessD mailing list