Report's page footers - again, next trick

  • Thread starter Thread starter Larry Kahm
  • Start date Start date
L

Larry Kahm

OK, I've resolved that the problem I was facing the other day was in the
report's page footer section - not the report footer section. Now it has
gotten even more complicated.

If there is more than one page of the report, I need to show >some<
information on the first page and >other< information on the final page.

On the first page, I need to include a list of cities - they must not appear
on any following page.
On the last page, I need to include a signature block - this must not appear
on any previous page.

I am totally stumped! I've tried logic in the page footer format event -
counting current page and total pages - and can't seem to find the right
mix.

Any help is greatly appreciated.

Thanks!

Larry
 
Thanks, but that path lead to a horror show in Preview mode.

Here's what I eventually came up with - and it seems to work. If anyone can
punch holes in it, please post a note.

In the Format event of the Page Footer section

intP = Me!txtPage
intS = Me!txtPages
If FormatCount >= 1 Then
intT = intP+intS
Select Case intT
Case 4
' print signatures
' hide city
Case 3
' hide signatures
' print city
Case Else
' print signatures
' print city
End Select
End if

Larry
 
Larry:

You are testing for the FormatCount property being >= 1, which will always
evaluate to True. I suspect you might be misunderstanding the way the
FormatCount property works. It returns the number of times the section's
OnFormat event property has been evaluated for the current section. It is
reset to 1 when the next section is formatted. The number of iterations
through the report, which might be what you have in mind here, is not
relevant. To determine that you can set a value of a module level variable
in the report footer's Format event procedure so that the variable only has
that value on the second iteration through the report.

In your case as you are assigning values to the two variables locally in the
event procedure it looks to me like you can forget about the FormatCount
property completely as the values are not going to change however many times
the section is formatted.

Going back to your original post:

If Pages = 1 Then
' one page report so
' show both signature and city
Else
' multi page report so
If Page = 1 Then
' first page so show the city and hide the signature
Else
If Page = Pages
' last page so show signature and hide city
Else
' intervening pages
' what do you do here? Hide both?
End If
End If

Ken Sheridan
Stafford, England
 
Ken,

I am going to try that suggestion later tonight. If it works - as I suspect
it will - then I'll clean up the code.

Thanks!

Larry
 

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

Back
Top