A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Turning page header on and off



 
 
Thread Tools Display Modes
  #1  
Old January 4th, 2010, 06:10 PM posted to microsoft.public.access.reports
Bob Howard
external usenet poster
 
Posts: 71
Default Turning page header on and off

I have a report with several group headers (and one has a footer), plus a
page header section. These are a series of receipts for money received.

On the first page of each receipt, I don't want to print the page header
section. The first (most major) group header section contains all the
information to be printed at the top of the first page of any receipt.

But if any receipt continues to a second page, I do want to print the page
header section ... it's considered an "overflow" page and the header simply
contains the receipient's name and the column headings.

Using VBA code behind all this, I've been using the "page number control"
(in the header) as a flag to indicate whether the page header section should
print. Initially, this is set to zero. In the format event for the page
header section, I add one to the page number. If the result is one, then I
return with "Cancel=True" and the page header does not print. If the result
is other than one, I allow the page header section to print. I do all this
only when "FormatCount=1".

When the last line of an individual receipt prints, I set the page number to
zero again (in preparation for the next receipt). I know when the last line
prints because I have a special group footer with a print event. This group
footer will always be the last thing to print for the receipt, and merely
contains a small blank space (no controls).

Now here's the problem. Every so often, I'll be missing the "overflow" page
header. This should only occur when the page number is reset to zero. That
would indicate that the print event for that little blank area has fired.

Is it possible that I'm retreating from the print event and the entire
"overflow" page is being re-formatted? That's the only thing I can think
of.

Should I implement a "retreat" event for that little blank area where I set
the page number page to where it was before I made it a zero?

bob


  #2  
Old January 4th, 2010, 06:59 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Turning page header on and off

Bob Howard wrote:

I have a report with several group headers (and one has a footer), plus a
page header section. These are a series of receipts for money received.

On the first page of each receipt, I don't want to print the page header
section. The first (most major) group header section contains all the
information to be printed at the top of the first page of any receipt.

But if any receipt continues to a second page, I do want to print the page
header section ... it's considered an "overflow" page and the header simply
contains the receipient's name and the column headings.

Using VBA code behind all this, I've been using the "page number control"
(in the header) as a flag to indicate whether the page header section should
print. Initially, this is set to zero. In the format event for the page
header section, I add one to the page number. If the result is one, then I
return with "Cancel=True" and the page header does not print. If the result
is other than one, I allow the page header section to print. I do all this
only when "FormatCount=1".

When the last line of an individual receipt prints, I set the page number to
zero again (in preparation for the next receipt). I know when the last line
prints because I have a special group footer with a print event. This group
footer will always be the last thing to print for the receipt, and merely
contains a small blank space (no controls).

Now here's the problem. Every so often, I'll be missing the "overflow" page
header. This should only occur when the page number is reset to zero. That
would indicate that the print event for that little blank area has fired.

Is it possible that I'm retreating from the print event and the entire
"overflow" page is being re-formatted? That's the only thing I can think
of.

Should I implement a "retreat" event for that little blank area where I set
the page number page to where it was before I made it a zero?



I don't think it's that complicated. Not sure, but a
possible(?) reason for it not working on some pages is
because small blank space is split across a page boundary.
Regardless, the group foogter section needs to have it's
KeepTogether property set to Yes.

I would approach this a little differently. First, make the
special group footer invisible or set it's Height to 0.
Second, remove the code for the page header. Then use the
report header Print event to make the page header section
invisible:
Me.Section(2).Visible = False
and put the same line in your group footer's Print event.

Add a line in the group header's Print event to make it
visible again:
Me.Section(2).Visible = True
and make sure the group header section's ForceNewPage
property is set to Before Section

--
Marsh
MVP [MS Access]
  #3  
Old January 4th, 2010, 08:55 PM posted to microsoft.public.access.reports
Bob Howard
external usenet poster
 
Posts: 71
Default Turning page header on and off

I see what you're getting at, but I think the group footer print event won't
fire if the group footer height is zero (or not visible). It's detected at
the time the group footer is formatted that there's nothing to print.

The group footer (the special one with the little blank space) is not
causing the page to overflow since all the receipts in the test run are 2
pages long anyway. The place where the footer prints is about halfway down
on the second page.

And the height of that footer is.0007" ... which is the smallest allowed.
So it's not likely that it'll cause a page overflow even if the situation
could even occur where it would be exactly at the bottom of the page.

I think I'll give the idea of saving the page number in the footer print
event (before I set it to zero) and restoring it in a retreat event (I don't
have a retreat event right now, but I'll make one for this test).

And I'll keep you posted.

bob

"Marshall Barton" wrote in message
...
Bob Howard wrote:

I have a report with several group headers (and one has a footer), plus a
page header section. These are a series of receipts for money received.

On the first page of each receipt, I don't want to print the page header
section. The first (most major) group header section contains all the
information to be printed at the top of the first page of any receipt.

But if any receipt continues to a second page, I do want to print the page
header section ... it's considered an "overflow" page and the header
simply
contains the receipient's name and the column headings.

Using VBA code behind all this, I've been using the "page number control"
(in the header) as a flag to indicate whether the page header section
should
print. Initially, this is set to zero. In the format event for the page
header section, I add one to the page number. If the result is one, then
I
return with "Cancel=True" and the page header does not print. If the
result
is other than one, I allow the page header section to print. I do all
this
only when "FormatCount=1".

When the last line of an individual receipt prints, I set the page number
to
zero again (in preparation for the next receipt). I know when the last
line
prints because I have a special group footer with a print event. This
group
footer will always be the last thing to print for the receipt, and merely
contains a small blank space (no controls).

Now here's the problem. Every so often, I'll be missing the "overflow"
page
header. This should only occur when the page number is reset to zero.
That
would indicate that the print event for that little blank area has fired.

Is it possible that I'm retreating from the print event and the entire
"overflow" page is being re-formatted? That's the only thing I can think
of.

Should I implement a "retreat" event for that little blank area where I
set
the page number page to where it was before I made it a zero?



I don't think it's that complicated. Not sure, but a
possible(?) reason for it not working on some pages is
because small blank space is split across a page boundary.
Regardless, the group foogter section needs to have it's
KeepTogether property set to Yes.

I would approach this a little differently. First, make the
special group footer invisible or set it's Height to 0.
Second, remove the code for the page header. Then use the
report header Print event to make the page header section
invisible:
Me.Section(2).Visible = False
and put the same line in your group footer's Print event.

Add a line in the group header's Print event to make it
visible again:
Me.Section(2).Visible = True
and make sure the group header section's ForceNewPage
property is set to Before Section

--
Marsh
MVP [MS Access]



  #4  
Old January 4th, 2010, 11:59 PM posted to microsoft.public.access.reports
Bob Howard
external usenet poster
 
Posts: 71
Default Turning page header on and off

Actually, it was something else. My logic was correct, but I had an error
in another spot. Data for THE PRIOR receipt was making is past the filter,
but I was then deleting the detail records because I determined they should
not print. I ended up deleting all detail records for the account
immediately preceeding the one where the page didn't overflow correctly.
And this messed up the logic.

I'll work on my filter to broaden its scope somehow ... or at least figure
out how to cope with this situation.

Thanks...

bob


"Marshall Barton" wrote in message
...
Bob Howard wrote:

I have a report with several group headers (and one has a footer), plus a
page header section. These are a series of receipts for money received.

On the first page of each receipt, I don't want to print the page header
section. The first (most major) group header section contains all the
information to be printed at the top of the first page of any receipt.

But if any receipt continues to a second page, I do want to print the page
header section ... it's considered an "overflow" page and the header
simply
contains the receipient's name and the column headings.

Using VBA code behind all this, I've been using the "page number control"
(in the header) as a flag to indicate whether the page header section
should
print. Initially, this is set to zero. In the format event for the page
header section, I add one to the page number. If the result is one, then
I
return with "Cancel=True" and the page header does not print. If the
result
is other than one, I allow the page header section to print. I do all
this
only when "FormatCount=1".

When the last line of an individual receipt prints, I set the page number
to
zero again (in preparation for the next receipt). I know when the last
line
prints because I have a special group footer with a print event. This
group
footer will always be the last thing to print for the receipt, and merely
contains a small blank space (no controls).

Now here's the problem. Every so often, I'll be missing the "overflow"
page
header. This should only occur when the page number is reset to zero.
That
would indicate that the print event for that little blank area has fired.

Is it possible that I'm retreating from the print event and the entire
"overflow" page is being re-formatted? That's the only thing I can think
of.

Should I implement a "retreat" event for that little blank area where I
set
the page number page to where it was before I made it a zero?



I don't think it's that complicated. Not sure, but a
possible(?) reason for it not working on some pages is
because small blank space is split across a page boundary.
Regardless, the group foogter section needs to have it's
KeepTogether property set to Yes.

I would approach this a little differently. First, make the
special group footer invisible or set it's Height to 0.
Second, remove the code for the page header. Then use the
report header Print event to make the page header section
invisible:
Me.Section(2).Visible = False
and put the same line in your group footer's Print event.

Add a line in the group header's Print event to make it
visible again:
Me.Section(2).Visible = True
and make sure the group header section's ForceNewPage
property is set to Before Section

--
Marsh
MVP [MS Access]



  #5  
Old January 5th, 2010, 06:13 AM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Turning page header on and off

You're right, my bad. That should be the group footer
Format event. I also had the wrong section number, the page
header is Section 3.

Sorry for making a hash of it. I have done this dozens of
times and should not make silly mistakes like that.
--
Marsh
MVP [MS Access]


Bob Howard wrote:
I see what you're getting at, but I think the group footer print event won't
fire if the group footer height is zero (or not visible). It's detected at
the time the group footer is formatted that there's nothing to print.

The group footer (the special one with the little blank space) is not
causing the page to overflow since all the receipts in the test run are 2
pages long anyway. The place where the footer prints is about halfway down
on the second page.

And the height of that footer is.0007" ... which is the smallest allowed.
So it's not likely that it'll cause a page overflow even if the situation
could even occur where it would be exactly at the bottom of the page.

I think I'll give the idea of saving the page number in the footer print
event (before I set it to zero) and restoring it in a retreat event (I don't
have a retreat event right now, but I'll make one for this test).


"Marshall Barton" wrote
Bob Howard wrote:
I have a report with several group headers (and one has a footer), plus a
page header section. These are a series of receipts for money received.

On the first page of each receipt, I don't want to print the page header
section. The first (most major) group header section contains all the
information to be printed at the top of the first page of any receipt.

But if any receipt continues to a second page, I do want to print the page
header section ... it's considered an "overflow" page and the header
simply
contains the receipient's name and the column headings.

Using VBA code behind all this, I've been using the "page number control"
(in the header) as a flag to indicate whether the page header section
should
print. Initially, this is set to zero. In the format event for the page
header section, I add one to the page number. If the result is one, then
I
return with "Cancel=True" and the page header does not print. If the
result
is other than one, I allow the page header section to print. I do all
this
only when "FormatCount=1".

When the last line of an individual receipt prints, I set the page number
to
zero again (in preparation for the next receipt). I know when the last
line
prints because I have a special group footer with a print event. This
group
footer will always be the last thing to print for the receipt, and merely
contains a small blank space (no controls).

Now here's the problem. Every so often, I'll be missing the "overflow"
page
header. This should only occur when the page number is reset to zero.
That
would indicate that the print event for that little blank area has fired.

Is it possible that I'm retreating from the print event and the entire
"overflow" page is being re-formatted? That's the only thing I can think
of.

Should I implement a "retreat" event for that little blank area where I
set
the page number page to where it was before I made it a zero?



I don't think it's that complicated. Not sure, but a
possible(?) reason for it not working on some pages is
because small blank space is split across a page boundary.
Regardless, the group foogter section needs to have it's
KeepTogether property set to Yes.

I would approach this a little differently. First, make the
special group footer invisible or set it's Height to 0.
Second, remove the code for the page header. Then use the
report header Print event to make the page header section
invisible:
Me.Section(2).Visible = False
and put the same line in your group footer's Print event.

Add a line in the group header's Print event to make it
visible again:
Me.Section(2).Visible = True
and make sure the group header section's ForceNewPage
property is set to Before Section


  #6  
Old January 6th, 2010, 07:37 PM posted to microsoft.public.access.reports
Bob Howard
external usenet poster
 
Posts: 71
Default Turning page header on and off

That's ok ... I fixed my "filtering problem" and it's now working. Except
for something else that I'll start a new thread for ... there's one extra
blank line on the report. bob

"Marshall Barton" wrote in message
...
You're right, my bad. That should be the group footer
Format event. I also had the wrong section number, the page
header is Section 3.

Sorry for making a hash of it. I have done this dozens of
times and should not make silly mistakes like that.
--
Marsh
MVP [MS Access]


Bob Howard wrote:
I see what you're getting at, but I think the group footer print event
won't
fire if the group footer height is zero (or not visible). It's detected
at
the time the group footer is formatted that there's nothing to print.

The group footer (the special one with the little blank space) is not
causing the page to overflow since all the receipts in the test run are 2
pages long anyway. The place where the footer prints is about halfway
down
on the second page.

And the height of that footer is.0007" ... which is the smallest allowed.
So it's not likely that it'll cause a page overflow even if the situation
could even occur where it would be exactly at the bottom of the page.

I think I'll give the idea of saving the page number in the footer print
event (before I set it to zero) and restoring it in a retreat event (I
don't
have a retreat event right now, but I'll make one for this test).


"Marshall Barton" wrote
Bob Howard wrote:
I have a report with several group headers (and one has a footer), plus
a
page header section. These are a series of receipts for money received.

On the first page of each receipt, I don't want to print the page header
section. The first (most major) group header section contains all the
information to be printed at the top of the first page of any receipt.

But if any receipt continues to a second page, I do want to print the
page
header section ... it's considered an "overflow" page and the header
simply
contains the receipient's name and the column headings.

Using VBA code behind all this, I've been using the "page number
control"
(in the header) as a flag to indicate whether the page header section
should
print. Initially, this is set to zero. In the format event for the page
header section, I add one to the page number. If the result is one,
then
I
return with "Cancel=True" and the page header does not print. If the
result
is other than one, I allow the page header section to print. I do all
this
only when "FormatCount=1".

When the last line of an individual receipt prints, I set the page
number
to
zero again (in preparation for the next receipt). I know when the last
line
prints because I have a special group footer with a print event. This
group
footer will always be the last thing to print for the receipt, and
merely
contains a small blank space (no controls).

Now here's the problem. Every so often, I'll be missing the "overflow"
page
header. This should only occur when the page number is reset to zero.
That
would indicate that the print event for that little blank area has
fired.

Is it possible that I'm retreating from the print event and the entire
"overflow" page is being re-formatted? That's the only thing I can
think
of.

Should I implement a "retreat" event for that little blank area where I
set
the page number page to where it was before I made it a zero?


I don't think it's that complicated. Not sure, but a
possible(?) reason for it not working on some pages is
because small blank space is split across a page boundary.
Regardless, the group foogter section needs to have it's
KeepTogether property set to Yes.

I would approach this a little differently. First, make the
special group footer invisible or set it's Height to 0.
Second, remove the code for the page header. Then use the
report header Print event to make the page header section
invisible:
Me.Section(2).Visible = False
and put the same line in your group footer's Print event.

Add a line in the group header's Print event to make it
visible again:
Me.Section(2).Visible = True
and make sure the group header section's ForceNewPage
property is set to Before Section




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.