By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,830 Members | 1,758 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,830 IT Pros & Developers. It's quick & easy.

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

P: n/a
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/

Oct 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a


On Oct 3, 8:54 pm, "SEFL" <a...@searchenginefriendlylayouts.comwrote:
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

Oct 5 '06 #2

P: n/a
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.

de***************@gmail.com wrote:
On Oct 3, 8:54 pm, "SEFL" <a...@searchenginefriendlylayouts.comwrote:
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
Oct 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.