Hiding Group Footer based on condition

  • Thread starter Thread starter Macker
  • Start date Start date
M

Macker

Can anyone tell me how to hide Group Footer based on a condition? Below is an
example of output. I want to display subtotal only if number of projects are
more than 2. Company B has only 2 projects and no sub total should be
displayed.

Company A
Project1 Cost $1000
Project2 Cost $1000
Project3 Cost $1000
Sub Total $3000

Company B
Project1 Cost $1000
Project2 Cost $1000

Company C
Project1 Cost $1000
Project2 Cost $1000
Project3 Cost $1000
Project4 Cost $1000
Sub Total $4000
 
Marshall, Thank you for your quick response. I have tried as you mentioned.
The subtotal still shows in the report for all groups. The text box shows
number of records correctly, but looks like my Format event is not
working/firing. Below is the code I used. When I run my report I do not even
see any message box. I am not sure what am I missing...Please advise.

FYI...I tested other events (OnPaint, OnClick) and they are firing correctly.

Private Sub CompanyFooter_Format(Cancel As Integer, FormatCount As Integer)
MsgBox (Me.txtNumProjects.Value)
Cancel = (Me.txtNumProjects.Value <= 3)
End Sub
---------------------------------------------------------------------
 
Marshall,

It is working when I run the report in "Print Preview", but not in "Report
View"...Thank you for your help with this...
 
Back
Top