Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another Question about Suppressing sections

Status
Not open for further replies.

crystalfun

Programmer
Feb 8, 2001
39
0
0
US
I have been able to Suppress the detail section of my Access Report with the following code:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.SUM < 100000 Then
Reports!Copy.Section(acDetail).Visible = False
Else
Reports!Copy.Section(acDetail).Visible = True
End If

End Sub

However, I can't Suppress the Footer or Header associated with the detail. The code is below. If anyone has any ideas how I can get this to work please let me know. All of the code is run off of the Event Procedure OnFormat.
Thanks.

Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If Me.SUM < 100000 Then
Reports!Copy.Section(acGroupFooter1).Visible = False
Else
Reports!Copy.Section(acGroupFooter1).Visible = True
End If

End Sub

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
If Me.SUM < 100000 Then
Reports!Copy.Section(acGroupHeader0).Visible = False
Else
Reports!Copy.Section(acGroupHeader0).Visible = True
End If

End Sub
 
I believe the Section constant would be acGroupLevel1Footer, not acGroupFooter1.

Or, more simply you could use the Me keyword:
Code:
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
If Me.SUM < 100000 Then
Me.Visible = False
Else
Me.Visible = True
End If

End Sub

Let me know if this helps.....
 
It works. Thanks.

Interesting to note that when the data is Analyzed with Excel the totals are now hard coded rather than summed in a formula. Must have something to do with suppressing the data rather than excluding it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top