View Single Post
  #8  
Old June 7th, 2010, 06:16 PM posted to microsoft.public.access.reports
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Force the group footer to print on the first page

A footer won't print in the middle of a section as such. The best you could
probably do would be to print the 'footer' data in the page footer of the
first page. Instead of a group footer create a group header and put the
controls containing data currently in the group footer in it, all contiguous
with the top of the section. Set the height of each control to zero and the
height of the group header itself to zero.

Next, in the page footer add the necessary labels and a set of unbound text
box controls which reference the controls in the group header, e.g.

=[SomeControl]
=[SomeOtherControl]

and so on.

In the page footer's Format event procedure hide the controls in the page
footer after page 1 with:

Me.[SomeLabel].Visible = (Page = 1)
Me.[txtSomeControl].Visible = (Page = 1)
Me.[SomeOtherLabel].Visible = (Page = 1)
Me.[txtSomeOtherControl].Visible = (Page = 1)

and so on.

This does of course mean that the page footer needs to be deep enough to hold
the controls, and as the page footer has no CanShrink property its depth will
be the same on subsequent pages, so you'll have some empty white space
between the bottom of the last detail on the page and the page number.

The above does what you asked in your first post, which is to show it only on
the "first page of an Access 2007 Report". However, I wonder whether you
really want it on the first page of each group? If so you'd need a slightly
different approach:

First declare a variable in the report's module's Declarations area:

Dim intPage As Integer

Then in the group header's Format event procedure assign the value of the
current page to the variable:

intPage = Page

Then in the page footer's Format event procedure show the controls only if
the page is the first page of a group:

Me.[txtSomeControl].Visible = (Page = intPage)
Me.[txtSomeOtherControl].Visible = (Page = intPage)

and so on.

Ken Sheridan
Stafford, England

VBNovice10 wrote:
My report is based off of a current form we manually create through Microsoft
Word for every customer. Each customer may have anywhere from 1 to 300
items, so the detail section length varies. But I want to populate the
report through Access from my database to expedite the former form creation.

My report has a report header with a logo, a page header with recurring data
on each page, a detail section with rows of data populated by rows in my
database, a group footer, a page footer with page numbers, and a report
footer which takes up the entire last page.

I was hoping there was a code/method to force the group footer to always
print on the "first page" only regardless of the number of rows in the detail
section. The main question is can a group footer be forced to print in the
middle of a group section?

Thank you for your help. Please let me know if you need more detail.

Hello.

[quoted text clipped - 21 lines]
Still? I thought that is WAS displayed and you wanted it to be displayed
ONLY on the first page? What is the page number of the desired page?


--
Message posted via http://www.accessmonster.com