A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Hiding Group Footer based on condition



 
 
Thread Tools Display Modes
  #1  
Old May 20th, 2010, 04:54 PM posted to microsoft.public.access.reports
Macker
external usenet poster
 
Posts: 5
Default Hiding Group Footer based on condition

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
  #2  
Old May 20th, 2010, 05:19 PM posted to microsoft.public.access.reports
Marshall Barton
external usenet poster
 
Posts: 5,361
Default Hiding Group Footer based on condition

Macker wrote:

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



Add a tet box (named txtNumProjects) to the group header or
footer section and set its expression to =Count(*)

Then add a line of VBA code to the footer section's Format
event procedu
Cancel = (Me.txtNumProjects = 2)

--
Marsh
MVP [MS Access]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.