Hiding/Showing Group footer

acepayne

Registered User.
Local time
Today, 21:40
Joined
Jul 26, 2001
Messages
44
Greetings!

I have a report that is grouped by a field called GroupCode. The GroupCode can be either a 0 or a 1. Essentially, this is intended to divide the report in half, so to speak. What I want to do is show the group footer after the first group, but not after the second group. Something like this:

Number
-------
100
200
300
400
-------------------------
Group footer
-------------------------
500
600
700
800

Now, I have tried some different combinations of things (after scouring this forum for suggestions), but I have yet to get this working perfectly.

I added some code to the group section's format event that switches the visible property of the controls in there, based on the value of the GroupCode. Something like so:

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)
If GroupCode > 0 Then
txtControl.Visible = False
Else
txtControl.Visible = True
End If
End Sub

Now, this works *great* when I open the report in preview mode. Actually, it works just fine if I open the report in print mode. HOWEVER, if I preview the report, and then print, both group footers are hidden.

Like I said, I've tried some different combinations of things, but have yet to get it right, so I am asking if someone can give me the definitive solution to this.

As usual, much appreciation for taking the time to look at this!

Thanks,
Ace
 

Users who are viewing this thread

Back
Top Bottom