Programatically Hide/Collapse Group Header

  • Thread starter Thread starter mj
  • Start date Start date
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!
 
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
 
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?
 
Back
Top