Programatically Hide/Collapse Group Header

M

mj

Hi. I have a report that has two group headers: SalesRep
and SalesRepSub. The SalesRepSub is sort of like a junior
rep as you might expect. I have customer accounts listed
in the detail section and the sales rollup to the
SalesRepSub and the SalesRep levels. The problem is that
only about a quarter of the SalesReps have SalesRepSubs
under them, so there's an awkward gap on the page with an
empty SalesRepSub. Is there any way to programatically
collpase the SalesRepSub group header to height=0 if it
has a Null value, it's value is N/A or something like
that? Any suggestions would be terrific! Thanks!
 
S

SA

Sure, look up the PrintSection property of reports in the help file. Then
in the On print event of that header:

If IsNull(Me!JuniorRep) or Len(Me!JuniorRep) < 1 Then
Me.PrintSection = False
Else
Me.PrintSection = True
End if
 
M

mj

Cool! Thanks! It looks like it didn't collapse the header
thought. Is there a way to do something like Set
SectionHeight = 0 for only those sections?
 

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