Connecting Tech Pros Worldwide Forums | Help | Site Map

.ForceNewPage affects all group footers, .Visible does not.

SEFL
Guest
 
Posts: n/a
#1: Oct 4 '06
Hi there,

I've got a code sample below from a report from a computer database
that I have built with a printer subtable, which in turn generates a
printer subreport that I'm trying to put on its own page (one page has
hardware, one has software, one if necessary has the printers...not
every machine has a printer).

The subreport is contained within a group footer, which by default has
ForceNewPage set to "None" and Visible set to "Yes".

The code sample follows:

Current_ID = Me.Computer_ID
SQL_Query = "Select Count (Printer_ID) as Printer_Count from
Printers where Attached_To = " & Current_ID
Set recTmp = dbTmp.OpenRecordset(SQL_Query)
Printer_Count = CLng(recTmp!Printer_Count)
Bool_Check = Abs(Printer_Count 0)
Me.Printer_Subreport_Footer.Visible = Bool_Check
Me.Printer_Subreport_Footer.ForceNewPage = Bool_Check

The problem is that the .Visible property works exactly as I intended
it to (i.e. displaying the individual subreport footer if there are
printers for the Computer_ID, and not displaying the subreport footer
if there are no printers for Computer_ID); however, .the .ForceNewPage
property affects ALL of the subreport footers as a whole, rather than
each individual one that I want.

If I remove this line of code, I get a blank page at the end of my
report.

HELP!

Thanks.



Adam
http://www.searchenginefriendlylayouts.com/


deluxeinformation@gmail.com
Guest
 
Posts: n/a
#2: Oct 5 '06

re: .ForceNewPage affects all group footers, .Visible does not.




On Oct 3, 8:54 pm, "SEFL" <a...@searchenginefriendlylayouts.comwrote:
Quote:
Hi there,
>
I've got a code sample below from a report from a computer database
that I have built with a printer subtable, which in turn generates a
printer subreport that I'm trying to put on its own page (one page has
hardware, one has software, one if necessary has the printers...not
every machine has a printer).
>
The subreport is contained within a group footer, which by default has
ForceNewPage set to "None" and Visible set to "Yes".
>
The code sample follows:
>
Current_ID = Me.Computer_ID
SQL_Query = "Select Count (Printer_ID) as Printer_Count from
Printers where Attached_To = " & Current_ID
Set recTmp = dbTmp.OpenRecordset(SQL_Query)
Printer_Count = CLng(recTmp!Printer_Count)
Bool_Check = Abs(Printer_Count 0)
Me.Printer_Subreport_Footer.Visible = Bool_Check
Me.Printer_Subreport_Footer.ForceNewPage = Bool_Check
>
The problem is that the .Visible property works exactly as I intended
it to (i.e. displaying the individual subreport footer if there are
printers for the Computer_ID, and not displaying the subreport footer
if there are no printers for Computer_ID); however, .the .ForceNewPage
property affects ALL of the subreport footers as a whole, rather than
each individual one that I want.
>
If I remove this line of code, I get a blank page at the end of my
report.
I'm not quite sure I follow what you're trying to do here but you may
want to try adding a page break control to your report (or subreport)
and setting its visible property to bool_check rather than setting the
forcenewpage property of your group footer.

HTH,
Bruce

SEFL
Guest
 
Posts: n/a
#3: Oct 6 '06

re: .ForceNewPage affects all group footers, .Visible does not.


Thanks, dude. That's sort of what I did (although I solved it on
Tuesday).

For those who want to try this themselves, the answer is a little
different than what MS suggests:

1) Put a Page break control at Top 0, Left 0 in the footer itself.
2) Put the subreport overtop of the Page break control.
3) Replace the line in the code sample I posted pertaining to
..ForceNewPage with something like Me.Group_Footer.Page_Break.Visible =
Bool_Check (substitute Group_Footer and Page_Break with the names of
your group footer and page break.)

Hope this helps someone at some point.


The page break will be visible and triggered if and only if the footer
itself is visible.

So the code I used below will work, if you use the PageBreak on the
footer itself.

deluxeinformation@gmail.com wrote:
Quote:
On Oct 3, 8:54 pm, "SEFL" <a...@searchenginefriendlylayouts.comwrote:
Quote:
Hi there,

I've got a code sample below from a report from a computer database
that I have built with a printer subtable, which in turn generates a
printer subreport that I'm trying to put on its own page (one page has
hardware, one has software, one if necessary has the printers...not
every machine has a printer).

The subreport is contained within a group footer, which by default has
ForceNewPage set to "None" and Visible set to "Yes".

The code sample follows:

Current_ID = Me.Computer_ID
SQL_Query = "Select Count (Printer_ID) as Printer_Count from
Printers where Attached_To = " & Current_ID
Set recTmp = dbTmp.OpenRecordset(SQL_Query)
Printer_Count = CLng(recTmp!Printer_Count)
Bool_Check = Abs(Printer_Count 0)
Me.Printer_Subreport_Footer.Visible = Bool_Check
Me.Printer_Subreport_Footer.ForceNewPage = Bool_Check

The problem is that the .Visible property works exactly as I intended
it to (i.e. displaying the individual subreport footer if there are
printers for the Computer_ID, and not displaying the subreport footer
if there are no printers for Computer_ID); however, .the .ForceNewPage
property affects ALL of the subreport footers as a whole, rather than
each individual one that I want.

If I remove this line of code, I get a blank page at the end of my
report.
>
I'm not quite sure I follow what you're trying to do here but you may
want to try adding a page break control to your report (or subreport)
and setting its visible property to bool_check rather than setting the
forcenewpage property of your group footer.
>
HTH,
Bruce
Closed Thread


Similar Microsoft Access / VBA bytes