Eliminate Group Footer

W

Wahab

Hi there,
In a report I have Report Header; Page Header; CustomerID Header; Detail;
CustomerID Footer ; Page Footer and Report Footer. In CustomerID Footer I m
doing the sum( RvTotal) which will just add the RV and bring the total of
each customers receipts.
In a customerID Footer , I don’t want to show the sum of RV when customer
paid only 1 time only.
Please help me How I will write the code?
Thanks
 
E

Evi

I'll call the control that contains the sum txtSum

Add a control txtCount (invisible) to the customerID footer with the text
=Count(*)

In the On Format Event of the Footer Section (if you have no other code in
this section) put this code just above End Sub editing as indicated in the
comments

Dim ctrl As Control

For each ctrl in Me.Section(x).Controls
'replace x with the correct Section number for your group footer
If Me.txtCount >1 Then
ctrl.Visible = True
Else
ctrl.Visible = False
End If
Next ctrl
Me.txtCount.Visible = False
'make txtCount invisible whatever happens

Evi
 
W

Wahab

Evi said:
I'll call the control that contains the sum txtSum

Add a control txtCount (invisible) to the customerID footer with the text
=Count(*)

In the On Format Event of the Footer Section (if you have no other code in
this section) put this code just above End Sub editing as indicated in the
comments

Dim ctrl As Control

For each ctrl in Me.Section(x).Controls
'replace x with the correct Section number for your group footer
If Me.txtCount >1 Then
ctrl.Visible = True
Else
ctrl.Visible = False
End If
Next ctrl
Me.txtCount.Visible = False
'make txtCount invisible whatever happens

Evi
Thanks Evi for your quick reply,
Seems code is working as im not getting any error message, but it is not
hiding my codes are as follows:
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
Dim Ctrl As Control

For Each Ctrl In Section(1).Controls
If Me.txtCount > 1 Then
Ctrl.Visible = True
Else
Ctrl.Visible = False
End If
Next Ctrl
Me.txtCount.Visible = False
End Sub
i dont have to set Ctrl = txtSum? even than also not hidding?
Pls check
 
E

Evi

Wahab said:
Thanks Evi for your quick reply,
Seems code is working as im not getting any error message, but it is not
hiding my codes are as follows:
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
Dim Ctrl As Control

For Each Ctrl In Section(1).Controls
If Me.txtCount > 1 Then
Ctrl.Visible = True
Else
Ctrl.Visible = False
End If
Next Ctrl
Me.txtCount.Visible = False
End Sub
i dont have to set Ctrl = txtSum? even than also not hidding?
Pls check


The problem is the Section number. I should have explained this.
As a logical person, you thought that GroupFooter1 would be Section 1. If
you look up the section property in Help you will see that Section 1 is the
Report Header. GroupFooter1 is probably 6.

Evi
 
W

Wahab

Evi said:
The problem is the Section number. I should have explained this.
As a logical person, you thought that GroupFooter1 would be Section 1. If
you look up the section property in Help you will see that Section 1 is the
Report Header. GroupFooter1 is probably 6.

Evi
Thanks Evi, it is working perfectly.
 

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