make page footer invisible

A

adgorn

In the detail section of a report called Payment Receipt , I display the
result of a query, Expr2, in a text box. (This will be a number (dollar
amount) that is different for every record. FYI the text box is also called
Expr2.) If that value = 0, I do not want the page footer to display. So I
used the following code in OnFormat for the detail section:

If [Reports]![payment receipt].[Expr2] = 0 Then
[Reports]![payment receipt].[Section](4).Visible = False
End If

It doesn't work. Any help? Thanks.
 
J

John Spencer

I would try
Me.Section(acPageFooter).Visible = False

Or even
[Reports]![payment receipt].Section(4).Visible = False

Also I see you are testing for 0. Is it possible that the value is not
zero, but is Null or some value very close to zero? You can handle that
with a test as follows

If Abs(Nz(Me.Expr2,0)) < .00000001 Then
Me.Section(acPageFooter).Visible = False
End If
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
A

adgorn

Thanks for responding. I fixed the problem by moving the test up into the
page header section. I guess that gives it a better place in the timing of
things. With the test in the detail section, the results were incorrect, but
there was a pattern. Every time there were 2 records in a row that should
display, the first was triggered. If there was only one in a row, it would
not not display.
--
Alan


John Spencer said:
I would try
Me.Section(acPageFooter).Visible = False

Or even
[Reports]![payment receipt].Section(4).Visible = False

Also I see you are testing for 0. Is it possible that the value is not
zero, but is Null or some value very close to zero? You can handle that
with a test as follows

If Abs(Nz(Me.Expr2,0)) < .00000001 Then
Me.Section(acPageFooter).Visible = False
End If
--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

adgorn said:
In the detail section of a report called Payment Receipt , I display the
result of a query, Expr2, in a text box. (This will be a number (dollar
amount) that is different for every record. FYI the text box is also
called
Expr2.) If that value = 0, I do not want the page footer to display. So
I
used the following code in OnFormat for the detail section:

If [Reports]![payment receipt].[Expr2] = 0 Then
[Reports]![payment receipt].[Section](4).Visible = False
End If

It doesn't work. Any help? Thanks.
 

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