suppressing page footer

B

Brian Bastl

Hi all,

I have an invoice report which contains 2 subreports. Normally, everything
fits on 1 page. But in those instances where either or both subreports grow
and force a 2nd page, I'd like to only show the page footer on the last
page. Page footer contains some calculated totals from subreports.

I tried the following, but in both instances the footer disappears from the
report entirely:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = ([Page] = [Pages])
End Sub

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = (Me.[Page] = [Pages])
End Sub

What am I not doing correctly?

TIA,
BB
 
B

Brian Bastl

Hi Duane,

no, I have an unbound text ctl [txtPage] with control source =[Page].
Also have an unbound text ctl [txtPages] with control source =[Pages]

I appreciate any guidance/ suggestions.

Brian
 
B

Brian Bastl

don't know if it matters, but
MS Office Pro 2k
References - DAO only
compiles fine

if I use the following code, then the page footer displays on the first page
only (exactly the opposite of what I'm trying to accomplish)

<code>
'Me.PageFooterSection.Visible = ([Page] <> [Pages])

but...

'Me.PageFooterSection.Visible = ([Page] = [Pages])
suppresses footer on both pages

Brian

Duane Hookom said:
Do you have a text box in your report bound to Page or Pages?

--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
Hi all,

I have an invoice report which contains 2 subreports. Normally, everything
fits on 1 page. But in those instances where either or both subreports
grow
and force a 2nd page, I'd like to only show the page footer on the last
page. Page footer contains some calculated totals from subreports.

I tried the following, but in both instances the footer disappears from
the
report entirely:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = ([Page] = [Pages])
End Sub

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = (Me.[Page] = [Pages])
End Sub

What am I not doing correctly?

TIA,
BB
 
D

Duane Hookom

Does the main report have a record source?
What happens with this code:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Cancel = ([Page] = [Pages])
End Sub

--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
don't know if it matters, but
MS Office Pro 2k
References - DAO only
compiles fine

if I use the following code, then the page footer displays on the first
page
only (exactly the opposite of what I'm trying to accomplish)

<code>
'Me.PageFooterSection.Visible = ([Page] <> [Pages])

but...

'Me.PageFooterSection.Visible = ([Page] = [Pages])
suppresses footer on both pages

Brian

Duane Hookom said:
Do you have a text box in your report bound to Page or Pages?

--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
Hi all,

I have an invoice report which contains 2 subreports. Normally, everything
fits on 1 page. But in those instances where either or both subreports
grow
and force a 2nd page, I'd like to only show the page footer on the last
page. Page footer contains some calculated totals from subreports.

I tried the following, but in both instances the footer disappears from
the
report entirely:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = ([Page] = [Pages])
End Sub

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = (Me.[Page] = [Pages])
End Sub

What am I not doing correctly?

TIA,
BB
 
B

Brian Bastl

Hi Duane,

Yes, the main report has a record source as do the subreports, which are
linked via [JobID].

In any case, trying to set the visible property of the PageFooterSection
resulted in either no visible pagefooter throughout the report =>
"Me.PageFooterSection.Visible = ([Page] = [Pages])"

or having it visible only on the first page => "Me.PageFooterSection.Visible
= ([Page] <> [Pages])"

The SOLUTION I came up with was to set the visible properties of the
individual controls within the PageFooterSection
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.AmtDue.Visible = ([Page] = [Pages])
Me.AmtDue_Label.Visible = ([Page] = [Pages])
etc...
etc...
End Sub

In this vain, I tried iterating through all of the controls within the
PageFooterSection to set their respective properties, but couldn't get the
syntax right to exclude the two controls "txtPage" and "txtPages".

Thanks for all of your help,
Brian



Duane Hookom said:
Does the main report have a record source?
What happens with this code:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Cancel = ([Page] = [Pages])
End Sub

--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
don't know if it matters, but
MS Office Pro 2k
References - DAO only
compiles fine

if I use the following code, then the page footer displays on the first
page
only (exactly the opposite of what I'm trying to accomplish)

<code>
'Me.PageFooterSection.Visible = ([Page] <> [Pages])

but...

'Me.PageFooterSection.Visible = ([Page] = [Pages])
suppresses footer on both pages

Brian

Duane Hookom said:
Do you have a text box in your report bound to Page or Pages?

--
Duane Hookom
MS Access MVP
--

Hi all,

I have an invoice report which contains 2 subreports. Normally, everything
fits on 1 page. But in those instances where either or both subreports
grow
and force a 2nd page, I'd like to only show the page footer on the last
page. Page footer contains some calculated totals from subreports.

I tried the following, but in both instances the footer disappears from
the
report entirely:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = ([Page] = [Pages])
End Sub

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = (Me.[Page] = [Pages])
End Sub

What am I not doing correctly?

TIA,
BB
 
D

Duane Hookom

I am very surprised that your first attempt didn't work (or the Cancel=...).
I would try re-create the main report to see if there might have been some
corruption.

--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
Hi Duane,

Yes, the main report has a record source as do the subreports, which are
linked via [JobID].

In any case, trying to set the visible property of the PageFooterSection
resulted in either no visible pagefooter throughout the report =>
"Me.PageFooterSection.Visible = ([Page] = [Pages])"

or having it visible only on the first page =>
"Me.PageFooterSection.Visible
= ([Page] <> [Pages])"

The SOLUTION I came up with was to set the visible properties of the
individual controls within the PageFooterSection
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.AmtDue.Visible = ([Page] = [Pages])
Me.AmtDue_Label.Visible = ([Page] = [Pages])
etc...
etc...
End Sub

In this vain, I tried iterating through all of the controls within the
PageFooterSection to set their respective properties, but couldn't get the
syntax right to exclude the two controls "txtPage" and "txtPages".

Thanks for all of your help,
Brian



Duane Hookom said:
Does the main report have a record source?
What happens with this code:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Cancel = ([Page] = [Pages])
End Sub

--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
don't know if it matters, but
MS Office Pro 2k
References - DAO only
compiles fine

if I use the following code, then the page footer displays on the first
page
only (exactly the opposite of what I'm trying to accomplish)

<code>
'Me.PageFooterSection.Visible = ([Page] <> [Pages])

but...

'Me.PageFooterSection.Visible = ([Page] = [Pages])
suppresses footer on both pages

Brian

Do you have a text box in your report bound to Page or Pages?

--
Duane Hookom
MS Access MVP
--

Hi all,

I have an invoice report which contains 2 subreports. Normally,
everything
fits on 1 page. But in those instances where either or both subreports
grow
and force a 2nd page, I'd like to only show the page footer on the last
page. Page footer contains some calculated totals from subreports.

I tried the following, but in both instances the footer disappears from
the
report entirely:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = ([Page] = [Pages])
End Sub

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = (Me.[Page] = [Pages])
End Sub

What am I not doing correctly?

TIA,
BB
 
B

Brian Bastl

Using Cancel = ([Page] = [Pages]), footer showed up on both pages. I just
created a new report, but the outcome was the same.

Thanks again,
Brian

Duane Hookom said:
I am very surprised that your first attempt didn't work (or the Cancel=...).
I would try re-create the main report to see if there might have been some
corruption.

--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
Hi Duane,

Yes, the main report has a record source as do the subreports, which are
linked via [JobID].

In any case, trying to set the visible property of the PageFooterSection
resulted in either no visible pagefooter throughout the report =>
"Me.PageFooterSection.Visible = ([Page] = [Pages])"

or having it visible only on the first page =>
"Me.PageFooterSection.Visible
= ([Page] <> [Pages])"

The SOLUTION I came up with was to set the visible properties of the
individual controls within the PageFooterSection
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.AmtDue.Visible = ([Page] = [Pages])
Me.AmtDue_Label.Visible = ([Page] = [Pages])
etc...
etc...
End Sub

In this vain, I tried iterating through all of the controls within the
PageFooterSection to set their respective properties, but couldn't get the
syntax right to exclude the two controls "txtPage" and "txtPages".

Thanks for all of your help,
Brian



Duane Hookom said:
Does the main report have a record source?
What happens with this code:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Cancel = ([Page] = [Pages])
End Sub

--
Duane Hookom
MS Access MVP
--

don't know if it matters, but
MS Office Pro 2k
References - DAO only
compiles fine

if I use the following code, then the page footer displays on the first
page
only (exactly the opposite of what I'm trying to accomplish)

<code>
'Me.PageFooterSection.Visible = ([Page] <> [Pages])

but...

'Me.PageFooterSection.Visible = ([Page] = [Pages])
suppresses footer on both pages

Brian

Do you have a text box in your report bound to Page or Pages?

--
Duane Hookom
MS Access MVP
--

Hi all,

I have an invoice report which contains 2 subreports. Normally,
everything
fits on 1 page. But in those instances where either or both subreports
grow
and force a 2nd page, I'd like to only show the page footer on the last
page. Page footer contains some calculated totals from subreports.

I tried the following, but in both instances the footer disappears from
the
report entirely:

Private Sub PageFooterSection_Format(Cancel As Integer,
FormatCount
As
Integer)
Me.PageFooterSection.Visible = ([Page] = [Pages])
End Sub

Private Sub PageFooterSection_Format(Cancel As Integer,
FormatCount
As
Integer)
Me.PageFooterSection.Visible = (Me.[Page] = [Pages])
End Sub

What am I not doing correctly?

TIA,
BB
 
D

Duane Hookom

You don't have fields named Page and/or Pages in your report's record source
do you?

--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
Using Cancel = ([Page] = [Pages]), footer showed up on both pages. I just
created a new report, but the outcome was the same.

Thanks again,
Brian

Duane Hookom said:
I am very surprised that your first attempt didn't work (or the Cancel=...).
I would try re-create the main report to see if there might have been
some
corruption.

--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
Hi Duane,

Yes, the main report has a record source as do the subreports, which
are
linked via [JobID].

In any case, trying to set the visible property of the
PageFooterSection
resulted in either no visible pagefooter throughout the report =>
"Me.PageFooterSection.Visible = ([Page] = [Pages])"

or having it visible only on the first page =>
"Me.PageFooterSection.Visible
= ([Page] <> [Pages])"

The SOLUTION I came up with was to set the visible properties of the
individual controls within the PageFooterSection
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.AmtDue.Visible = ([Page] = [Pages])
Me.AmtDue_Label.Visible = ([Page] = [Pages])
etc...
etc...
End Sub

In this vain, I tried iterating through all of the controls within the
PageFooterSection to set their respective properties, but couldn't get the
syntax right to exclude the two controls "txtPage" and "txtPages".

Thanks for all of your help,
Brian



Does the main report have a record source?
What happens with this code:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Cancel = ([Page] = [Pages])
End Sub

--
Duane Hookom
MS Access MVP
--

don't know if it matters, but
MS Office Pro 2k
References - DAO only
compiles fine

if I use the following code, then the page footer displays on the first
page
only (exactly the opposite of what I'm trying to accomplish)

<code>
'Me.PageFooterSection.Visible = ([Page] <> [Pages])

but...

'Me.PageFooterSection.Visible = ([Page] = [Pages])
suppresses footer on both pages

Brian

Do you have a text box in your report bound to Page or Pages?

--
Duane Hookom
MS Access MVP
--

Hi all,

I have an invoice report which contains 2 subreports. Normally,
everything
fits on 1 page. But in those instances where either or both
subreports
grow
and force a 2nd page, I'd like to only show the page footer on
the
last
page. Page footer contains some calculated totals from
subreports.

I tried the following, but in both instances the footer
disappears
from
the
report entirely:

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount
As
Integer)
Me.PageFooterSection.Visible = ([Page] = [Pages])
End Sub

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount
As
Integer)
Me.PageFooterSection.Visible = (Me.[Page] = [Pages])
End Sub

What am I not doing correctly?

TIA,
BB
 
B

Brian Bastl

You don't have fields named Page and/or Pages in your report's record
source

no I don't. Main Report record source is a stored query as follows:

SELECT tblJobs.JobID, tblJobs.JobLocation, [tblClients].[ClientFirst] & " "
& [tblClients].[ClientName] AS Client, tblClients.ClientStreet,
[tblClients].[ClientCity] & ", " & [tblClients].[ClientState] & " " &
[tblClients].[ClientZip] AS CityStateZip, Q_Payments.TotalPayments, (SELECT
MAX([WorkDate]) FROM tblTimeCard WHERE
((tblTimeCard.JobID=Forms!frmClientsExpanded!JobID))) AS LastDate
FROM (tblJobs INNER JOIN tblClients ON tblJobs.ClientID =
tblClients.ClientID) INNER JOIN Q_Payments ON tblJobs.JobID =
Q_Payments.JobID
WHERE (((tblJobs.JobID)=[Forms]![frmClientsExpanded]![JobID]));

Controls in main report's page footer:
LastDate (bound)

TotalPayments(bound)

InvoiceTotal
=IIf([srptInvoiceLabor].[Report].[HasData],[srptInvoiceLabor].[Report]![txtL
abSum],0)+IIf([srptInvoiceExpenses].[Report].[HasData],[srptInvoiceExpenses]
..[Report]![txtExpSum],0)

AmtDue = [InvoiceTotal]-[TotalPayments]

"txtPage" and "txtPages" are also located in the PageFooter with control
sources of =[Page] and =[Pages] respectively.

Sorry if that was more info than you wanted.

Brian
 
D

Duane Hookom

How about this?
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = (Me.[txtPage] = Me.[txtPages])
End Sub
Do these text boxes display the correct values?


--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
You don't have fields named Page and/or Pages in your report's record source
do you?

no I don't. Main Report record source is a stored query as follows:

SELECT tblJobs.JobID, tblJobs.JobLocation, [tblClients].[ClientFirst] & "
"
& [tblClients].[ClientName] AS Client, tblClients.ClientStreet,
[tblClients].[ClientCity] & ", " & [tblClients].[ClientState] & " " &
[tblClients].[ClientZip] AS CityStateZip, Q_Payments.TotalPayments,
(SELECT
MAX([WorkDate]) FROM tblTimeCard WHERE
((tblTimeCard.JobID=Forms!frmClientsExpanded!JobID))) AS LastDate
FROM (tblJobs INNER JOIN tblClients ON tblJobs.ClientID =
tblClients.ClientID) INNER JOIN Q_Payments ON tblJobs.JobID =
Q_Payments.JobID
WHERE (((tblJobs.JobID)=[Forms]![frmClientsExpanded]![JobID]));

Controls in main report's page footer:
LastDate (bound)

TotalPayments(bound)

InvoiceTotal
=IIf([srptInvoiceLabor].[Report].[HasData],[srptInvoiceLabor].[Report]![txtL
abSum],0)+IIf([srptInvoiceExpenses].[Report].[HasData],[srptInvoiceExpenses]
.[Report]![txtExpSum],0)

AmtDue = [InvoiceTotal]-[TotalPayments]

"txtPage" and "txtPages" are also located in the PageFooter with control
sources of =[Page] and =[Pages] respectively.

Sorry if that was more info than you wanted.

Brian
 
B

Brian Bastl

How about this?
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = (Me.[txtPage] = Me.[txtPages])
End Sub
Do these text boxes display the correct values?

Doing the above makes the page footer invisible on both pages. By the way,
on the respective control's property sheets, Visible is set to "No". That
said, when I change them to "YES", the correct values do display. Ultimately
however, txtPage and txtPages should never be visible.

Brian
 
K

Ken Snell \(MVP\)

Move the code to the "Print" event of the PageFooter...that may produce the
result you seek.

--

Ken Snell
<MS ACCESS MVP>

Brian Bastl said:
How about this?
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.PageFooterSection.Visible = (Me.[txtPage] = Me.[txtPages])
End Sub
Do these text boxes display the correct values?

Doing the above makes the page footer invisible on both pages. By the way,
on the respective control's property sheets, Visible is set to "No". That
said, when I change them to "YES", the correct values do display.
Ultimately
however, txtPage and txtPages should never be visible.

Brian
 
B

Brian Bastl

Move the code to the "Print" event of the PageFooter...that may produce
the
result you seek.

Do you mean PageFooterSection_Print or PageFooter_Print?
the first hides the footer on the second page. PageFooter_Print is not
listed as a procedure.

Brian
 
D

Duane Hookom

I created a test report and this code worked exactly as expected:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Cancel = ([Page] = [Pages])
End Sub
 
B

Brian Bastl

Thanks Duane,

Since you were able to get it to work, I'll delve deeper into it tomorrow.
Perhaps I need to examine my subreports. Perhaps therein lies the glitch.
Thanks for sticking with this. Now I'm really determined.

Brian

Duane Hookom said:
I created a test report and this code worked exactly as expected:
Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Cancel = ([Page] = [Pages])
End Sub

--
Duane Hookom
MS Access MVP
--

Brian Bastl said:
Do you mean PageFooterSection_Print or PageFooter_Print?
the first hides the footer on the second page. PageFooter_Print is not
listed as a procedure.

Brian
 

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