Connecting Tech Pros Worldwide Forums | Help | Site Map

Hiding a Report Footer on Report Open

Member
 
Join Date: Sep 2007
Posts: 94
#1: Jan 18 '08
Upon opening a Report i have created, i need to hide the report footer when 2 text boxes contain the same numeric value.

I am hoping something will be possible using the Height property of the page footer, though i have my reservations about whether this will work when the footer contains data.

The only other way i can think of would be to make all fields contained in the footer Invisible, though this will

Can anyone supply me some VB they think might help?
Does anyone have any ideas?

Thanks!

Expert
 
Join Date: Sep 2007
Posts: 256
#2: Jan 18 '08

re: Hiding a Report Footer on Report Open


In the 'On Format' event of the Footer section of your report write the code shown in line 3;-
Expand|Select|Wrap|Line Numbers
  1. Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
  2.  
  3. If Me!Text2 = Me!Text0 Then Cancel = True
  4.  
  5. End Sub
where Text0 and Text2 are the names of the two text boxes being evaluated.

S7
Minion's Avatar
Expert
 
Join Date: Dec 2007
Posts: 98
#3: Jan 18 '08

re: Hiding a Report Footer on Report Open


I'm taking it you're talking about two of the text boxes on the report. If they are different boxes the code will be different, but for now put the following code in the form's on open event:
Expand|Select|Wrap|Line Numbers
  1. with me
  2.    if .Text1 = .Text2 then
  3.       .PageFooterSection.Visible = False
  4.    end if
  5. end with
  6.  
This should hide the footer of the report if the two boxes are equal.

Hope this helps.

- Minion -

Quote:

Originally Posted by Lewe22

Upon opening a Report i have created, i need to hide the report footer when 2 text boxes contain the same numeric value.

I am hoping something will be possible using the Height property of the page footer, though i have my reservations about whether this will work when the footer contains data.

The only other way i can think of would be to make all fields contained in the footer Invisible, though this will

Can anyone supply me some VB they think might help?
Does anyone have any ideas?

Thanks!

Member
 
Join Date: Sep 2007
Posts: 94
#4: Jan 23 '08

re: Hiding a Report Footer on Report Open


Thanks Sierra7. Your code worked great!
Reply