Footer only to appear once!

B

Bob Vance

I have a report with a footer , Information about my company, but my report
has a Sub/Report that mat stretch to 4 or 5 pages is it possible for footer
only to appear on the last page at the Bottom
 
M

Marshall Barton

Bob said:
I have a report with a footer , Information about my company, but my report
has a Sub/Report that mat stretch to 4 or 5 pages is it possible for footer
only to appear on the last page at the Bottom


I presume the footer you are talking about is the report's
Page Footer section.

You can make the page footer section visible/invisible by
using code in the page *header* section's Format (or Print)
event:

Me.Section(4).Visible = (Me.Page = Me.Pages)

This requires that you have a text box (somewhere) that uses
the report's Pages property.
 
B

Bob Vance

Marshall I made a text box that in my header that shows me how many pages
[txtMaxpage]
If Me.Pages = 0 Then
Me.txtMaxpage = Me.Page
Me.Section(4).Visible = (Me.txtMaxpage = Me.Pages)
and have another text box showing :
="Page " & [Page] & " of " & [Pages]
It is taking away the footer from the first pages but the last page is not
showing my Reports/Footer
Thanks for the help....Bob
 
M

Marshall Barton

When you post code, please use Copy/Paste so we don't have
to deal with typing mistakes or omissions.

Why are you using all that to calculate the last page
number? It seems to me that it should make the page footer
visible on every page. There may be a valid reason for
calculating txtMaxPage, but you need to compare it to
Me.Page, not to Me.Pages

What are you referring to when you say "Reports/Footer"?
There can be a Report footer and/or a Page footer, but only
the Page footer appears at the bottom of the page.

But there may be a discrepancy to this whole idea. If the
first time through (when Pages=0), the last page's page
footer will be invisible, leaving more space for the detail
data. The second time through the report when the page
footer on the last page is visible, there may not be enough
space for all the data so it wasn't really the last page. I
conclude from this thought experiment that trying to reclaim
the page footer's space on all but the last page is not
reliable. You can test this by seeing if the page of pages
text box displays something goofy like Page 7 of 6

If you can live without reclaiming the page footer space,
then just move the line of code from the page header event
to the page footer's Format event.
--
Marsh
MVP [MS Access]


Bob said:
Marshall I made a text box that in my header that shows me how many pages
[txtMaxpage]
If Me.Pages = 0 Then
Me.txtMaxpage = Me.Page
Me.Section(4).Visible = (Me.txtMaxpage = Me.Pages)
and have another text box showing :
="Page " & [Page] & " of " & [Pages]
It is taking away the footer from the first pages but the last page is not
showing my Reports/Footer
Thanks for the help....Bob

I presume the footer you are talking about is the report's
Page Footer section.

You can make the page footer section visible/invisible by
using code in the page *header* section's Format (or Print)
event:

Me.Section(4).Visible = (Me.Page = Me.Pages)

This requires that you have a text box (somewhere) that uses
the report's Pages property.
 
B

Bob Vance

Marshall, I am struggling with this, txtmaxPage is showing me the last page
but i am not getting my footer on that last page....regards bob
If Me.Pages = 0 Then
Me.txtMaxpage = Me.Page
Me.Section(4).Visible = (Me.txtMaxpage <> Me.Page)

Marshall Barton said:
When you post code, please use Copy/Paste so we don't have
to deal with typing mistakes or omissions.

Why are you using all that to calculate the last page
number? It seems to me that it should make the page footer
visible on every page. There may be a valid reason for
calculating txtMaxPage, but you need to compare it to
Me.Page, not to Me.Pages

What are you referring to when you say "Reports/Footer"?
There can be a Report footer and/or a Page footer, but only
the Page footer appears at the bottom of the page.

But there may be a discrepancy to this whole idea. If the
first time through (when Pages=0), the last page's page
footer will be invisible, leaving more space for the detail
data. The second time through the report when the page
footer on the last page is visible, there may not be enough
space for all the data so it wasn't really the last page. I
conclude from this thought experiment that trying to reclaim
the page footer's space on all but the last page is not
reliable. You can test this by seeing if the page of pages
text box displays something goofy like Page 7 of 6

If you can live without reclaiming the page footer space,
then just move the line of code from the page header event
to the page footer's Format event.
--
Marsh
MVP [MS Access]


Bob said:
Marshall I made a text box that in my header that shows me how many pages
[txtMaxpage]
If Me.Pages = 0 Then
Me.txtMaxpage = Me.Page
Me.Section(4).Visible = (Me.txtMaxpage = Me.Pages)
and have another text box showing :
="Page " & [Page] & " of " & [Pages]
It is taking away the footer from the first pages but the last page is not
showing my Reports/Footer
Thanks for the help....Bob

Bob Vance wrote:
I have a report with a footer , Information about my company, but my
report
has a Sub/Report that mat stretch to 4 or 5 pages is it possible for
footer
only to appear on the last page at the Bottom


I presume the footer you are talking about is the report's
Page Footer section.

You can make the page footer section visible/invisible by
using code in the page *header* section's Format (or Print)
event:

Me.Section(4).Visible = (Me.Page = Me.Pages)

This requires that you have a text box (somewhere) that uses
the report's Pages property.
 
M

Marshall Barton

Please Copy/Paste the entire procedure so I can tell where
the code is and check to make sure there isn't something
else getting in the way.

You changed the = to <> so the page footer should be visible
on all but the last page.

Did you understand what I said about reclaiming the space
being unreliable?

It may help me understand your report a little better if you
explained why you are calculating txtMaxpage. Seems to me
you can just set the text box's control source expression to
=Pages
--
Marsh
MVP [MS Access]


Bob said:
Marshall, I am struggling with this, txtmaxPage is showing me the last page
but i am not getting my footer on that last page....regards bob
If Me.Pages = 0 Then
Me.txtMaxpage = Me.Page
Me.Section(4).Visible = (Me.txtMaxpage <> Me.Page)

When you post code, please use Copy/Paste so we don't have
to deal with typing mistakes or omissions.

Why are you using all that to calculate the last page
number? It seems to me that it should make the page footer
visible on every page. There may be a valid reason for
calculating txtMaxPage, but you need to compare it to
Me.Page, not to Me.Pages

What are you referring to when you say "Reports/Footer"?
There can be a Report footer and/or a Page footer, but only
the Page footer appears at the bottom of the page.

But there may be a discrepancy to this whole idea. If the
first time through (when Pages=0), the last page's page
footer will be invisible, leaving more space for the detail
data. The second time through the report when the page
footer on the last page is visible, there may not be enough
space for all the data so it wasn't really the last page. I
conclude from this thought experiment that trying to reclaim
the page footer's space on all but the last page is not
reliable. You can test this by seeing if the page of pages
text box displays something goofy like Page 7 of 6

If you can live without reclaiming the page footer space,
then just move the line of code from the page header event
to the page footer's Format event.
--
Marsh
MVP [MS Access]


Bob said:
Marshall I made a text box that in my header that shows me how many pages
[txtMaxpage]
If Me.Pages = 0 Then
Me.txtMaxpage = Me.Page
Me.Section(4).Visible = (Me.txtMaxpage = Me.Pages)
and have another text box showing :
="Page " & [Page] & " of " & [Pages]
It is taking away the footer from the first pages but the last page is not
showing my Reports/Footer
Thanks for the help....Bob

Bob Vance wrote:
I have a report with a footer , Information about my company, but my
report
has a Sub/Report that mat stretch to 4 or 5 pages is it possible for
footer
only to appear on the last page at the Bottom


I presume the footer you are talking about is the report's
Page Footer section.

You can make the page footer section visible/invisible by
using code in the page *header* section's Format (or Print)
event:

Me.Section(4).Visible = (Me.Page = Me.Pages)

This requires that you have a text box (somewhere) that uses
the report's Pages property.
 
B

Bob Vance

Thanks Marshall, Regards Bob
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
If tbCash = True Then
lblcash.Visible = True
Else
lblcash.Visible = False
If Me.Pages = 0 Then
Me.txtMaxpage = Me.Page
Me.Section(4).Visible = (Me.txtMaxpage <> Me.Page)


End If
End If
End Sub
Marshall Barton said:
Please Copy/Paste the entire procedure so I can tell where
the code is and check to make sure there isn't something
else getting in the way.

You changed the = to <> so the page footer should be visible
on all but the last page.

Did you understand what I said about reclaiming the space
being unreliable?

It may help me understand your report a little better if you
explained why you are calculating txtMaxpage. Seems to me
you can just set the text box's control source expression to
=Pages
--
Marsh
MVP [MS Access]


Bob said:
Marshall, I am struggling with this, txtmaxPage is showing me the last
page
but i am not getting my footer on that last page....regards bob
If Me.Pages = 0 Then
Me.txtMaxpage = Me.Page
Me.Section(4).Visible = (Me.txtMaxpage <> Me.Page)

When you post code, please use Copy/Paste so we don't have
to deal with typing mistakes or omissions.

Why are you using all that to calculate the last page
number? It seems to me that it should make the page footer
visible on every page. There may be a valid reason for
calculating txtMaxPage, but you need to compare it to
Me.Page, not to Me.Pages

What are you referring to when you say "Reports/Footer"?
There can be a Report footer and/or a Page footer, but only
the Page footer appears at the bottom of the page.

But there may be a discrepancy to this whole idea. If the
first time through (when Pages=0), the last page's page
footer will be invisible, leaving more space for the detail
data. The second time through the report when the page
footer on the last page is visible, there may not be enough
space for all the data so it wasn't really the last page. I
conclude from this thought experiment that trying to reclaim
the page footer's space on all but the last page is not
reliable. You can test this by seeing if the page of pages
text box displays something goofy like Page 7 of 6

If you can live without reclaiming the page footer space,
then just move the line of code from the page header event
to the page footer's Format event.
--
Marsh
MVP [MS Access]


Bob Vance wrote:
Marshall I made a text box that in my header that shows me how many
pages
[txtMaxpage]
If Me.Pages = 0 Then
Me.txtMaxpage = Me.Page
Me.Section(4).Visible = (Me.txtMaxpage = Me.Pages)
and have another text box showing :
="Page " & [Page] & " of " & [Pages]
It is taking away the footer from the first pages but the last page is
not
showing my Reports/Footer
Thanks for the help....Bob

Bob Vance wrote:
I have a report with a footer , Information about my company, but my
report
has a Sub/Report that mat stretch to 4 or 5 pages is it possible for
footer
only to appear on the last page at the Bottom


I presume the footer you are talking about is the report's
Page Footer section.

You can make the page footer section visible/invisible by
using code in the page *header* section's Format (or Print)
event:

Me.Section(4).Visible = (Me.Page = Me.Pages)

This requires that you have a text box (somewhere) that uses
the report's Pages property.
 
M

Marshall Barton

Please provide some clarification on the points that I asked
about.

I can not tell what this code will do without a very
specific detailed explanation of what it's supposed to be
doing. You have never said anything about hiding the page
footer only when tbCash is False. What do you do to
guarantee that the last page has tbCash is set to False?

Why haven't you changed the <> to =

At this point, I am about to give up and tell you, again, to
move the line:

Me.Section(4).Visible = (Me.Page = Me.Pages)

to the Page Footer section's Format event.
 
B

Bob Vance

Sorry Marshall, lblCash is just a label in my header that shows when there
is a true in the command to open the report!
I have done what you said , but my Pagefooter dosent appear on the last page
or any page actually..Regards Bob

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Section(4).Visible = (Me.Page = Me.Pages)

End Sub

Marshall Barton said:
Please provide some clarification on the points that I asked
about.

I can not tell what this code will do without a very
specific detailed explanation of what it's supposed to be
doing. You have never said anything about hiding the page
footer only when tbCash is False. What do you do to
guarantee that the last page has tbCash is set to False?

Why haven't you changed the <> to =

At this point, I am about to give up and tell you, again, to
move the line:

Me.Section(4).Visible = (Me.Page = Me.Pages)

to the Page Footer section's Format event.
--
Marsh
MVP [MS Access]


Bob said:
Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
If tbCash = True Then
lblcash.Visible = True
Else
lblcash.Visible = False
If Me.Pages = 0 Then
Me.txtMaxpage = Me.Page
Me.Section(4).Visible = (Me.txtMaxpage <> Me.Page)
End If
End If
End Sub

"Marshall Barton" wrote
 
M

Marshall Barton

Bob said:
lblCash is just a label in my header that shows when there
is a true in the command to open the report!
I have done what you said , but my Pagefooter dosent appear on the last page
or any page actually

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Section(4).Visible = (Me.Page = Me.Pages)

End Sub


The only reasons I can think of to explain why that didn't
work is:

a) Pages was not used in a text box expression

b) There is something else in the report's code that's
messing with the page number

c) You did not remove that code from the page header's
event.
 
B

Bob Vance

Ok this is going to sound stupid ,I have 3 check boxes that make labels
Visible but they are in my Page footer but are under this:
I have tried putting your code every where but it just takes the footer
away...Thanks Bob

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo ProcError

If tbCreditCard = True Then


lbBankName.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lbBranch.Visible = True
lbAccountName.Visible = True
lbAccountNumber.Visible = True
lbTopLabel.Visible = True
lbBankCode.Visible = True
Line116.Visible = True
Line117.Visible = True
Line118.Visible = True
Line108.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lbCreditCard.Visible = True
tbCreditCard2.Visible = True
tbCreditCard3.Visible = True
lbName.Visible = True
lbExpiry.Visible = True
lbSignature.Visible = True
Box136.Visible = True
Box137.Visible = True
Box138.Visible = True
Box139.Visible = True
Box140.Visible = True
Box142.Visible = True
Box143.Visible = True
Box144.Visible = True
Box145.Visible = True
Box146.Visible = True
Box147.Visible = True
Box148.Visible = True
Box149.Visible = True
Box150.Visible = True
Box152.Visible = True
Box153.Visible = True
Line169.Visible = True
Line191.Visible = True
Line170.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lblTick.Visible = True
BoxC1.Visible = True
tbCreditCard1.Visible = True
tbDirectBank.Visible = True
tbBranch.Visible = True
tbAccountName.Visible = True
tbAccountNumber.Visible = True
Line197.Visible = True
Line198.Visible = True
Line199.Visible = True
Line200.Visible = True
lblCheck1.Visible = True
lblCheck2.Visible = True
lblCheck3.Visible = True
tbChequePayableTo.Visible = True
tbCompanyAddress1.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lblcash.Visible = False
lblCash1.Visible = False
Else
lbBankName.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lbBranch.Visible = False
lbAccountName.Visible = False
lbAccountNumber.Visible = False
lbTopLabel.Visible = False
lbBankCode.Visible = False
Line116.Visible = False
Line117.Visible = False
Line118.Visible = False
Line108.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lbCreditCard.Visible = False
tbCreditCard2.Visible = False
tbCreditCard3.Visible = False
lbName.Visible = False
lbExpiry.Visible = False
lbSignature.Visible = False
Box136.Visible = False
Box137.Visible = False
Box138.Visible = False
Box139.Visible = False
Box140.Visible = False
Box142.Visible = False
Box143.Visible = False
Box144.Visible = False
Box145.Visible = False
Box146.Visible = False
Box147.Visible = False
Box148.Visible = False
Box149.Visible = False
Box150.Visible = False
Box152.Visible = False
Box153.Visible = False
Line169.Visible = False
Line191.Visible = False
Line170.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lblTick.Visible = False
BoxC1.Visible = False
tbCreditCard1.Visible = False
tbDirectBank.Visible = False
tbBranch.Visible = False
tbAccountName.Visible = False
tbAccountNumber.Visible = False
Line197.Visible = False
Line198.Visible = False
Line199.Visible = False
Line200.Visible = False
lblCheck1.Visible = False
lblCheck2.Visible = False
lblCheck3.Visible = False
tbChequePayableTo.Visible = False
tbCompanyAddress1.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lblcash.Visible = True
lblCash1.Visible = True

If tbNoCreditCard = True Then
lbBankName.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lbBranch.Visible = True
lbAccountName.Visible = True
lbAccountNumber.Visible = True
lbTopLabel.Visible = True
lbBankCode.Visible = True
Line116.Visible = True
Line117.Visible = True
Line118.Visible = True
Line108.Visible = True
BoxC2.Visible = False
BoxC3.Visible = False
lbCreditCard.Visible = False
tbCreditCard2.Visible = False
tbCreditCard3.Visible = False
lbName.Visible = False
lbExpiry.Visible = False
lbSignature.Visible = False
Box136.Visible = False
Box137.Visible = False
Box138.Visible = False
Box139.Visible = False
Box140.Visible = False
Box142.Visible = False
Box143.Visible = False
Box144.Visible = False
Box145.Visible = False
Box146.Visible = False
Box147.Visible = False
Box148.Visible = False
Box149.Visible = False
Box150.Visible = False
Box152.Visible = False
Box153.Visible = False
Line169.Visible = False
Line191.Visible = False
Line170.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lblTick.Visible = False
BoxC1.Visible = False
tbCreditCard1.Visible = False
tbDirectBank.Visible = True
tbBranch.Visible = True
tbAccountName.Visible = True
tbAccountNumber.Visible = True
Line197.Visible = True
Line198.Visible = True
Line199.Visible = True
Line200.Visible = True
lblCheck1.Visible = True
lblCheck2.Visible = True
lblCheck3.Visible = True
tbChequePayableTo.Visible = True
tbCompanyAddress1.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lblcash.Visible = False
lblCash1.Visible = False
Else

lbBankName.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lbBranch.Visible = False
lbAccountName.Visible = False
lbAccountNumber.Visible = False
lbTopLabel.Visible = False
lbBankCode.Visible = False
Line116.Visible = False
Line117.Visible = False
Line118.Visible = False
Line108.Visible = False
BoxC2.Visible = True
BoxC3.Visible = True
lbCreditCard.Visible = True
tbCreditCard2.Visible = True
tbCreditCard3.Visible = True
lbName.Visible = True
lbExpiry.Visible = True
lbSignature.Visible = True
Box136.Visible = True
Box137.Visible = True
Box138.Visible = True
Box139.Visible = True
Box140.Visible = True
Box142.Visible = True
Box143.Visible = True
Box144.Visible = True
Box145.Visible = True
Box146.Visible = True
Box147.Visible = True
Box148.Visible = True
Box149.Visible = True
Box150.Visible = True
Box152.Visible = True
Box153.Visible = True
Line169.Visible = True
Line191.Visible = True
Line170.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lblTick.Visible = True
BoxC1.Visible = True
tbCreditCard1.Visible = True
tbDirectBank.Visible = False
tbBranch.Visible = False
tbAccountName.Visible = False
tbAccountNumber.Visible = False
Line197.Visible = False
Line198.Visible = False
Line199.Visible = False
Line200.Visible = False
lblCheck1.Visible = False
lblCheck2.Visible = False
lblCheck3.Visible = False
tbChequePayableTo.Visible = False
tbCompanyAddress1.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lblcash.Visible = True
lblCash1.Visible = True

If tbCash = True Then
lbBankName.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lbBranch.Visible = False
lbAccountName.Visible = False
lbAccountNumber.Visible = False
lbTopLabel.Visible = False
lbBankCode.Visible = False
Line116.Visible = False
Line117.Visible = False
Line118.Visible = False
Line108.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lbCreditCard.Visible = False
tbCreditCard2.Visible = False
tbCreditCard3.Visible = False
lbName.Visible = False
lbExpiry.Visible = False
lbSignature.Visible = False
Box136.Visible = False
Box137.Visible = False
Box138.Visible = False
Box139.Visible = False
Box140.Visible = False
Box142.Visible = False
Box143.Visible = False
Box144.Visible = False
Box145.Visible = False
Box146.Visible = False
Box147.Visible = False
Box148.Visible = False
Box149.Visible = False
Box150.Visible = False
Box152.Visible = False
Box153.Visible = False
Line169.Visible = False
Line191.Visible = False
Line170.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lblTick.Visible = False
BoxC1.Visible = False
tbCreditCard1.Visible = False
tbDirectBank.Visible = False
tbBranch.Visible = False
tbAccountName.Visible = False
tbAccountNumber.Visible = False
Line197.Visible = False
Line198.Visible = False
Line199.Visible = False
Line200.Visible = False
lblCheck1.Visible = False
lblCheck2.Visible = False
lblCheck3.Visible = False
tbChequePayableTo.Visible = False
tbCompanyAddress1.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lblCash1.Visible = True
Else
lbBankName.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lbBranch.Visible = True
lbAccountName.Visible = True
lbAccountNumber.Visible = True
lbTopLabel.Visible = True
lbBankCode.Visible = True
Line116.Visible = True
Line117.Visible = True
Line118.Visible = True
Line108.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lbCreditCard.Visible = True
tbCreditCard2.Visible = True
tbCreditCard3.Visible = True
lbName.Visible = True
lbExpiry.Visible = True
lbSignature.Visible = True
Box136.Visible = True
Box137.Visible = True
Box138.Visible = True
Box139.Visible = True
Box140.Visible = True
Box142.Visible = True
Box143.Visible = True
Box144.Visible = True
Box145.Visible = True
Box146.Visible = True
Box147.Visible = True
Box148.Visible = True
Box149.Visible = True
Box150.Visible = True
Box152.Visible = True
Box153.Visible = True
Line169.Visible = True
Line191.Visible = True
Line170.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lblTick.Visible = True
BoxC1.Visible = True
tbCreditCard1.Visible = True
tbDirectBank.Visible = True
tbBranch.Visible = True
tbAccountName.Visible = True
tbAccountNumber.Visible = True
Line197.Visible = True
Line198.Visible = True
Line199.Visible = True
Line200.Visible = True
lblCheck1.Visible = True
lblCheck2.Visible = True
lblCheck3.Visible = True
tbChequePayableTo.Visible = True
tbCompanyAddress1.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lblCash1.Visible = False

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Detail_Format..."
Resume ExitProc
End If
End If
End If
End Sub

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Section(4).Visible = (Me.Page = Me.Pages)

End Sub
 
B

Bob Vance

Thanks Marshall . Ive got it , put the code in the header, and put the page
of pages there too BRILLIANT......Thanks Bob
Bob Vance said:
Ok this is going to sound stupid ,I have 3 check boxes that make labels
Visible but they are in my Page footer but are under this:
I have tried putting your code every where but it just takes the footer
away...Thanks Bob

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
On Error GoTo ProcError

If tbCreditCard = True Then


lbBankName.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lbBranch.Visible = True
lbAccountName.Visible = True
lbAccountNumber.Visible = True
lbTopLabel.Visible = True
lbBankCode.Visible = True
Line116.Visible = True
Line117.Visible = True
Line118.Visible = True
Line108.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lbCreditCard.Visible = True
tbCreditCard2.Visible = True
tbCreditCard3.Visible = True
lbName.Visible = True
lbExpiry.Visible = True
lbSignature.Visible = True
Box136.Visible = True
Box137.Visible = True
Box138.Visible = True
Box139.Visible = True
Box140.Visible = True
Box142.Visible = True
Box143.Visible = True
Box144.Visible = True
Box145.Visible = True
Box146.Visible = True
Box147.Visible = True
Box148.Visible = True
Box149.Visible = True
Box150.Visible = True
Box152.Visible = True
Box153.Visible = True
Line169.Visible = True
Line191.Visible = True
Line170.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lblTick.Visible = True
BoxC1.Visible = True
tbCreditCard1.Visible = True
tbDirectBank.Visible = True
tbBranch.Visible = True
tbAccountName.Visible = True
tbAccountNumber.Visible = True
Line197.Visible = True
Line198.Visible = True
Line199.Visible = True
Line200.Visible = True
lblCheck1.Visible = True
lblCheck2.Visible = True
lblCheck3.Visible = True
tbChequePayableTo.Visible = True
tbCompanyAddress1.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lblcash.Visible = False
lblCash1.Visible = False
Else
lbBankName.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lbBranch.Visible = False
lbAccountName.Visible = False
lbAccountNumber.Visible = False
lbTopLabel.Visible = False
lbBankCode.Visible = False
Line116.Visible = False
Line117.Visible = False
Line118.Visible = False
Line108.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lbCreditCard.Visible = False
tbCreditCard2.Visible = False
tbCreditCard3.Visible = False
lbName.Visible = False
lbExpiry.Visible = False
lbSignature.Visible = False
Box136.Visible = False
Box137.Visible = False
Box138.Visible = False
Box139.Visible = False
Box140.Visible = False
Box142.Visible = False
Box143.Visible = False
Box144.Visible = False
Box145.Visible = False
Box146.Visible = False
Box147.Visible = False
Box148.Visible = False
Box149.Visible = False
Box150.Visible = False
Box152.Visible = False
Box153.Visible = False
Line169.Visible = False
Line191.Visible = False
Line170.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lblTick.Visible = False
BoxC1.Visible = False
tbCreditCard1.Visible = False
tbDirectBank.Visible = False
tbBranch.Visible = False
tbAccountName.Visible = False
tbAccountNumber.Visible = False
Line197.Visible = False
Line198.Visible = False
Line199.Visible = False
Line200.Visible = False
lblCheck1.Visible = False
lblCheck2.Visible = False
lblCheck3.Visible = False
tbChequePayableTo.Visible = False
tbCompanyAddress1.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lblcash.Visible = True
lblCash1.Visible = True

If tbNoCreditCard = True Then
lbBankName.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lbBranch.Visible = True
lbAccountName.Visible = True
lbAccountNumber.Visible = True
lbTopLabel.Visible = True
lbBankCode.Visible = True
Line116.Visible = True
Line117.Visible = True
Line118.Visible = True
Line108.Visible = True
BoxC2.Visible = False
BoxC3.Visible = False
lbCreditCard.Visible = False
tbCreditCard2.Visible = False
tbCreditCard3.Visible = False
lbName.Visible = False
lbExpiry.Visible = False
lbSignature.Visible = False
Box136.Visible = False
Box137.Visible = False
Box138.Visible = False
Box139.Visible = False
Box140.Visible = False
Box142.Visible = False
Box143.Visible = False
Box144.Visible = False
Box145.Visible = False
Box146.Visible = False
Box147.Visible = False
Box148.Visible = False
Box149.Visible = False
Box150.Visible = False
Box152.Visible = False
Box153.Visible = False
Line169.Visible = False
Line191.Visible = False
Line170.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lblTick.Visible = False
BoxC1.Visible = False
tbCreditCard1.Visible = False
tbDirectBank.Visible = True
tbBranch.Visible = True
tbAccountName.Visible = True
tbAccountNumber.Visible = True
Line197.Visible = True
Line198.Visible = True
Line199.Visible = True
Line200.Visible = True
lblCheck1.Visible = True
lblCheck2.Visible = True
lblCheck3.Visible = True
tbChequePayableTo.Visible = True
tbCompanyAddress1.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lblcash.Visible = False
lblCash1.Visible = False
Else

lbBankName.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lbBranch.Visible = False
lbAccountName.Visible = False
lbAccountNumber.Visible = False
lbTopLabel.Visible = False
lbBankCode.Visible = False
Line116.Visible = False
Line117.Visible = False
Line118.Visible = False
Line108.Visible = False
BoxC2.Visible = True
BoxC3.Visible = True
lbCreditCard.Visible = True
tbCreditCard2.Visible = True
tbCreditCard3.Visible = True
lbName.Visible = True
lbExpiry.Visible = True
lbSignature.Visible = True
Box136.Visible = True
Box137.Visible = True
Box138.Visible = True
Box139.Visible = True
Box140.Visible = True
Box142.Visible = True
Box143.Visible = True
Box144.Visible = True
Box145.Visible = True
Box146.Visible = True
Box147.Visible = True
Box148.Visible = True
Box149.Visible = True
Box150.Visible = True
Box152.Visible = True
Box153.Visible = True
Line169.Visible = True
Line191.Visible = True
Line170.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lblTick.Visible = True
BoxC1.Visible = True
tbCreditCard1.Visible = True
tbDirectBank.Visible = False
tbBranch.Visible = False
tbAccountName.Visible = False
tbAccountNumber.Visible = False
Line197.Visible = False
Line198.Visible = False
Line199.Visible = False
Line200.Visible = False
lblCheck1.Visible = False
lblCheck2.Visible = False
lblCheck3.Visible = False
tbChequePayableTo.Visible = False
tbCompanyAddress1.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lblcash.Visible = True
lblCash1.Visible = True

If tbCash = True Then
lbBankName.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lbBranch.Visible = False
lbAccountName.Visible = False
lbAccountNumber.Visible = False
lbTopLabel.Visible = False
lbBankCode.Visible = False
Line116.Visible = False
Line117.Visible = False
Line118.Visible = False
Line108.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lbCreditCard.Visible = False
tbCreditCard2.Visible = False
tbCreditCard3.Visible = False
lbName.Visible = False
lbExpiry.Visible = False
lbSignature.Visible = False
Box136.Visible = False
Box137.Visible = False
Box138.Visible = False
Box139.Visible = False
Box140.Visible = False
Box142.Visible = False
Box143.Visible = False
Box144.Visible = False
Box145.Visible = False
Box146.Visible = False
Box147.Visible = False
Box148.Visible = False
Box149.Visible = False
Box150.Visible = False
Box152.Visible = False
Box153.Visible = False
Line169.Visible = False
Line191.Visible = False
Line170.Visible = False
BoxC2.Visible = False
BoxC3.Visible = False
lblTick.Visible = False
BoxC1.Visible = False
tbCreditCard1.Visible = False
tbDirectBank.Visible = False
tbBranch.Visible = False
tbAccountName.Visible = False
tbAccountNumber.Visible = False
Line197.Visible = False
Line198.Visible = False
Line199.Visible = False
Line200.Visible = False
lblCheck1.Visible = False
lblCheck2.Visible = False
lblCheck3.Visible = False
tbChequePayableTo.Visible = False
tbCompanyAddress1.Visible = False
tbOwnerShortName.Visible = False
tbOwnerShortNumber.Visible = False
lblCash1.Visible = True
Else
lbBankName.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lbBranch.Visible = True
lbAccountName.Visible = True
lbAccountNumber.Visible = True
lbTopLabel.Visible = True
lbBankCode.Visible = True
Line116.Visible = True
Line117.Visible = True
Line118.Visible = True
Line108.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lbCreditCard.Visible = True
tbCreditCard2.Visible = True
tbCreditCard3.Visible = True
lbName.Visible = True
lbExpiry.Visible = True
lbSignature.Visible = True
Box136.Visible = True
Box137.Visible = True
Box138.Visible = True
Box139.Visible = True
Box140.Visible = True
Box142.Visible = True
Box143.Visible = True
Box144.Visible = True
Box145.Visible = True
Box146.Visible = True
Box147.Visible = True
Box148.Visible = True
Box149.Visible = True
Box150.Visible = True
Box152.Visible = True
Box153.Visible = True
Line169.Visible = True
Line191.Visible = True
Line170.Visible = True
BoxC2.Visible = True
BoxC3.Visible = True
lblTick.Visible = True
BoxC1.Visible = True
tbCreditCard1.Visible = True
tbDirectBank.Visible = True
tbBranch.Visible = True
tbAccountName.Visible = True
tbAccountNumber.Visible = True
Line197.Visible = True
Line198.Visible = True
Line199.Visible = True
Line200.Visible = True
lblCheck1.Visible = True
lblCheck2.Visible = True
lblCheck3.Visible = True
tbChequePayableTo.Visible = True
tbCompanyAddress1.Visible = True
tbOwnerShortName.Visible = True
tbOwnerShortNumber.Visible = True
lblCash1.Visible = False

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in procedure Detail_Format..."
Resume ExitProc
End If
End If
End If
End Sub

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As
Integer)
Me.Section(4).Visible = (Me.Page = Me.Pages)

End Sub
 
B

Bob Vance

Marshall, Oops not quite working page 1 of 1 will not show footer, and any
last page that the footer wont fit will not show , my footer is 1/3 of a
page so if page 2 finishes in that area it wont show footer....Regards Bob

Bob Vance said:
Thanks Marshall . Ive got it , put the code in the header, and put the
page of pages there too BRILLIANT......Thanks Bob
 
M

Marshall Barton

Bob said:
Marshall, Oops not quite working page 1 of 1 will not show footer, and any
last page that the footer wont fit will not show , my footer is 1/3 of a
page so if page 2 finishes in that area it wont show footer....Regards Bob


That's the problem I tried to explain before.

With the page footer taking up 1/3 of the page, you clearly
need its space on all but the last page. Unfortunately, no
matter what tricks I try, I can not get the page 1 of 1
scenario to work. Even though the page footer's Visible
property is True, it still doesn't display on the first
page.

I think it's time to give up on using the page footer. How
about using the report footer instead? Is it really
critical that the last page info be at the bottom of the
page?
 
B

Bob Vance

Thanks Marshall you your effort and response, I actually made my footer 1/3
of the page so as after it is folded and posted the bottom part could be cut
off and posted back
If I made it smaller would it work?
Most of my clients don't push into page 2!
What if I create another report as well with a Report Footer then have a
code "if > page one print this report!
Then I come to another problem as I have a batch print that prints off all
my Statements
I suppose in a perfect world , if only page 1 page footer if more than page
1 report footer
Thanks............Bob
 
B

Bob Vance

OK got this figured now
(a)The code never shows the page footer on Page1 of 1 even if i just show
one record in the Sub/Report
(b) shows the page footer when more than 1 page only IF there is enough room
on the page otherwise no page footer
Regards Bob


Bob Vance said:
Thanks Marshall you your effort and response, I actually made my footer
1/3 of the page so as after it is folded and posted the bottom part could
be cut off and posted back
If I made it smaller would it work?
Most of my clients don't push into page 2!
What if I create another report as well with a Report Footer then have a
code "if > page one print this report!
Then I come to another problem as I have a batch print that prints off all
my Statements
I suppose in a perfect world , if only page 1 page footer if more than
page 1 report footer
Thanks............Bob
 
M

Marshall Barton

Bob said:
OK got this figured now
(a)The code never shows the page footer on Page1 of 1 even if i just show
one record in the Sub/Report

Right, that's the conclusion I came to as well.

(b) shows the page footer when more than 1 page only IF there is enough room
on the page otherwise no page footer

I got around this one in my tests by using a funky trick,
but it still won't work on the first page so who cares.

This has turned into a seriously nasty problem, but I would
like to think about it some more. One restriction that
might(?) allow for a different set of tricks to have some
relevance is if your report section are always the same
size. Maybe there's a way to tell before the report is
formatted whether we need the more than one page or not.
Please post back to tell me all if the sections in the
report and if any of them must have CanGrow set to Yes.
 
B

Bob Vance

Marshall, Detail can grow yes
Sub report can grow No.
Thanks Bob
Marshall Barton said:
Right, that's the conclusion I came to as well.



I got around this one in my tests by using a funky trick,
but it still won't work on the first page so who cares.

This has turned into a seriously nasty problem, but I would
like to think about it some more. One restriction that
might(?) allow for a different set of tricks to have some
relevance is if your report section are always the same
size. Maybe there's a way to tell before the report is
formatted whether we need the more than one page or not.
Please post back to tell me all if the sections in the
report and if any of them must have CanGrow set to Yes.
[/QUOTE]
 
M

Marshall Barton

Bob said:
Marshall, Detail can grow yes
Sub report can grow No.

Well shucks, that rules out several ideas I was
contemplating.

BUT, I finally stumbled over something that works in my
tests (using A2003). It's a little strange so pay attention
;-)

First, add a group (View menu - Sorting and Grouping) using
the expression =1. Specify Yes for the Group Footer.

Add a Page Break control (named pgEject) at the top of the
group footer section. (The Height of the group footer
section doesn't seem to matter!?)

Use the View menu to display the Report Footer section and
move everything you have in the page footer (the subreport?)
to the Report Footer section. Make the page footer
invisible or set its Height to 0.

Then put this code in the report's module. (Make sure you
remove any residual code from our earlier attempts.)

Const TPI As Long = 1440
Const PAPERHEIGHT As Long = 11 * TPI
Const BOTTOMMARGIN As Long = 0.5 * TPI

Private Sub GroupFooter1_Format(Cancel As Integer,
FormatCount As Integer)

Dim FooterTop As Long

FooterTop = PAPERHEIGHT - BOTTOMMARGIN _
- Me.Section(2).Height
If Me.Top >= FooterTop Then
Me.pgEject.Visible = True
Else
Me.pgEject.Visible = False
Me.GroupFooter1.Height = FooterTop - Me.Top
End If
End Sub

Double check that the group footer's OnFormat property is
set to [Event Procedure]

Do not ask me to explain why this worked. I have no idea
what Access is doing when it executes the true part of the
If when FormatCount=1 and the Else part when FormatCount=2.
 
B

Bob Vance

Marshall when I add a group it always goes to "=1 Header" is that correct
and where do I find yes for the group footer, remembering I am using 2007
Thanks Bob

Marshall Barton said:
Bob said:
Marshall, Detail can grow yes
Sub report can grow No.

Well shucks, that rules out several ideas I was
contemplating.

BUT, I finally stumbled over something that works in my
tests (using A2003). It's a little strange so pay attention
;-)

First, add a group (View menu - Sorting and Grouping) using
the expression =1. Specify Yes for the Group Footer.

Add a Page Break control (named pgEject) at the top of the
group footer section. (The Height of the group footer
section doesn't seem to matter!?)

Use the View menu to display the Report Footer section and
move everything you have in the page footer (the subreport?)
to the Report Footer section. Make the page footer
invisible or set its Height to 0.

Then put this code in the report's module. (Make sure you
remove any residual code from our earlier attempts.)

Const TPI As Long = 1440
Const PAPERHEIGHT As Long = 11 * TPI
Const BOTTOMMARGIN As Long = 0.5 * TPI

Private Sub GroupFooter1_Format(Cancel As Integer,
FormatCount As Integer)

Dim FooterTop As Long

FooterTop = PAPERHEIGHT - BOTTOMMARGIN _
- Me.Section(2).Height
If Me.Top >= FooterTop Then
Me.pgEject.Visible = True
Else
Me.pgEject.Visible = False
Me.GroupFooter1.Height = FooterTop - Me.Top
End If
End Sub

Double check that the group footer's OnFormat property is
set to [Event Procedure]

Do not ask me to explain why this worked. I have no idea
what Access is doing when it executes the true part of the
If when FormatCount=1 and the Else part when FormatCount=2.
 

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