Force the group footer to print on the first page

V

VBNovice10

Hello,

Does anyone know how to force the group footer to print only on the first
page of an Access 2007 Report?

Thank you in advance.
 
W

Wolfgang Kais

Hello "VBNovice10".

VBNovice10 said:
Hello,

Does anyone know how to force the group footer to print only on the first
page of an Access 2007 Report?

You could try to change the visibility of the group footer section in it's
format event, using a line like this:

Me.NameOfTheGroupFooterSection.Visible = (Me.Page = 1)
 
V

VBNovice10

Thank you for your help, but the code didn't work. The group footer still
did not appear on the first page. I may have to reconsider my report design.

Thank you again.
 
M

Marshall Barton

"the code didn't work" does not convey much information
beyond the fact that you did not like the result.

AFAICS, Wolfgang's code does what you asked for, so I am
guessing that there may be a flaw in your question or
terminology. Note that group footers only print at the end
of the group and do not have much at all to do with where a
page boundary happens to be. Maybe you really meant to say
page footer??
 
W

Wolfgang Kais

Hello.


VBNovice10 said:
Thank you for your help, but the code didn't work. The group footer
still did not appear on the first page. I may have to reconsider my
report design.

As Marshall Barton said, make sure that the section you associate the
code with is indeed the section you want to hide/display, and that the
name of the section used in code is correct. Always keep in mind that
a group footer will be displayd below the last detail record of
the group (on the same page, provided that there is enough space).
You could also verify the ForceNewPage property of the group footer.
Did you accidently set this property to "before section"?
You said "the group footer still did not appear on the first page".
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?
 
V

VBNovice10

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

Marshall Barton

VBNovice10 said:
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?

No. If the group footer displays some kinds of totals for
the group, those totals may not have been calculated until
the last detail has been processed. In that case it would
not make sense to try to print that kind of total the way
you want.

In some situations, a report can be made to use the page
footer to display something different (not running sum
totals) on specific pages, but this can get kind of
messy/tricky. If there is some way to fake what you want,
we would have to know a whole bunch of details about what
you need to display in this simulated "group footer".
 
K

KenSheridan via AccessMonster.com

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
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.
[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?
 
V

VBNovice10

Thank you for your quick response. As far as faking it, here are some
details of my report. My current group footer contains 4 signature blocks
tracking items exchanged from one person to another person. There are five
columns (Item#, Date, Released By, Received By, and Purpose, respectively).
The 4 rows track four different exchanges between individuals. The
information in this section is provided post printing and the framework is
needed only on the bottom of the first page. There is no computing or
calculations required to be filled into this section prior to printing.

Please let me know if you need further information or if my description is
unclear.

Thank you.
 
M

Marshall Barton

So all you need is a row of labels and 4 rows of empty boxes
(plus the pagemumber?), right? If so, you can do what Ken
suggested.

If you need to reduce the space used by the page footer to
just the page number on the other pages, then that's where
it gets tricky. One rule about changing the height of the
page footer section is that it needs to be done in a page
**header** event procedure. Another thing is that you can
not reduce the height of a section so the section's bottom
is above the bottom of the lowest control in the section.
This means that the controls have to be moved up in the
section first (the opposite is true when you move a control
down in the section). A vague outline of the page header
code would be something like:

Const ROWHGT = .25*1440 ' 1/4 inch each
Select Case Me.Page
Case 1
Me.Section(4).Height = 6*ROWHGT
Me.txtPageNum.Top = 5*ROWHGT
Me.lblItem.Visible = True
Me.lblDate.Visible = True
. . .
For k = 1 to 4
Me("boxItem" & k).Visible = True
Me("boxItem" & k).Top = k*ROWHGT
Me("boxDate" & k).Visible = True
Me("boxDate" & k).Top = k*ROWHGT
. . .
Next k
Case 2
Me.txtPageNum.Top = 0
Me.lblItem.Visible = False
Me.lblDate.Visible = False
. . .
For k = 1 to 4
Me("boxItem" & k).Visible = False
Me("boxItem" & k).Top = 0
Me("boxDate" & k).Visible = False
Me("boxDate" & k).Top = 0
. . .
Next k
Me.Section(4).Height = ROWHGT
End Select
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top