Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shrink Group Header when value is null? 1

Status
Not open for further replies.

stable

Programmer
Mar 19, 2003
92
NZ
Hi there,
I have set the report to group on a particular field subgrp and Group Header=Yes. In the report, the group header section contains an unbound textbox txtsubgrp. In the Onprint event for this group, I assign a value to this unbound field. In some instances I actually set the unbound textbox value to null because I don't want any value printed. This works fine - I have a blank group header sometimes.

I have also set the can shrink properties for the group header and the unbound text box to yes. Where the unbound text box is null I would like to "shrink" this group header area. But this does not appear to work - the blank group header remains.

Does anyone have any ideas how I can "shrink" the group header when the unbound text box value is null?

cheers
Stable
 
Sure this can be done with the .Visible property. In the OnFormat of the Group Header section put the following code:

Code:
If IsNull(me.txtsubgrp) then
   Reports![i][red]yourreportname[/red][/i].Section(5).Visible = False
else
   Reports![i][red]yourreportname[/red][/i].Section(5).Visible = True
End if

Report group sections are numbered in pairs(Header and Footer) starting with 5. Change the number to match the appropriate section.

Post back if you have questions.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Hi Bob,

Thanks very much for that tip. It works a treat!

Cheers
Stable
 
Stable: Glad that I could help you out. Good luck with your project.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Hi Bob,
Whoops I forgot to give you a star. The concept of stars is great as it highlights useful tips when searching through the forum!

cheers
Stable
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top