Reports - Hiding Headers and Groups etc

  • Thread starter Thread starter jackson via AccessMonster.com
  • Start date Start date
J

jackson via AccessMonster.com

Hi,

I have a report with a Header and Footer by Country (these are grouped under
Asset Class)

If my records are "Cash" or Position = 0 in my query, (cash being the
Position Type), I have made them invisible in the detail section using Me.
Section(acDetail).Visible = ([Posn Type] <> "Cash" And [Position] <> 0)
in the OnFormat function.

However, the Country Header and Footer still displays - however I'd like
these to be invisible when the above conditions are true and there are no
visible positions.

I'm a little unsure about how to go about getting this working...any help
would be appreciated.

I might add for the country footer, I also use: Cancel = (Me.txtCount <= 1)
in the OnFormat function so it doesn't subtotal when there's only one line...

Thanks.
 
jackson said:
I have a report with a Header and Footer by Country (these are grouped under
Asset Class)

If my records are "Cash" or Position = 0 in my query, (cash being the
Position Type), I have made them invisible in the detail section using Me.
Section(acDetail).Visible = ([Posn Type] <> "Cash" And [Position] <> 0)
in the OnFormat function.

However, the Country Header and Footer still displays - however I'd like
these to be invisible when the above conditions are true and there are no
visible positions.

I'm a little unsure about how to go about getting this working...any help
would be appreciated.

I might add for the country footer, I also use: Cancel = (Me.txtCount <= 1)
in the OnFormat function so it doesn't subtotal when there's only one line...


I think you can get the desired result by adding a textbox
named txtPositionCount to the group header. Set its control
source expression to:
=Sum([Posn Type] <> "Cash" And [Position] <> 0)
Then the headersection's Format event can use:
Cancel = (txtPositionCount = 0)
and combing that with your footer code:
Cancel = (Me.txtCount <= 1) Or (txtPositionCount = 0)
 
If you want to hide the Country Header and Footer when you hide the details
section add the following right before or right after the Me.Details.Visible
= False line:
Me.GroupHeader#.Visible = False
Me.GroupFooter#.Visible = False

# is the number that shows in the properties for the Header or Footer when
you click on it.

Don't forget to set the Header and Footer back to Visible = True when the
conditions to show them are met.

HTH
scruffy
 

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

Back
Top