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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Supress Group Header/Footer in Code

Status
Not open for further replies.

Meleagant

Programmer
Aug 31, 2001
166
US
Anyone know how to Supress a header/footer in code? I know I can...
Code:
Me.ZoneIdHeader.Visible = False
Me.AgentIdFooter.Visible = True

But they grouping still executes. Basically I have two group bands on the report. First by Zone Id and then by Agent Id. One the form the user can choose how they want to group the report and I change my SQL accordingly. If they only want to group by Agent, I then display the Zone for the order in the details section. But for some reason the report still is grouping the records even though I told it not to display the headers.

What i really want to do is selectively ignore certain group logic, supress it so it doesn't execute unless I explicitly tell it to.

Journeyman -- The Order of the Seekers of Truth and Penitence
 
Hiding or displaying grouping header sections will not have any effect on the sorting/grouping in the report. You would need to run code the change the ControlSource properties of grouping levels.


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I'm not sure what you mean. The controll source is a detailed query that I hand to the report. I want to tell the report to group on this and not that. I have tried
Code:
Me.GroupLevel(4).GroupHeader = False
But that didn't work, the property is read only at runtime

Journeyman -- The Order of the Seekers of Truth and Penitence
 
You can set the GroupLevel(..).ControlSource to change the sorting and grouping expressions. You can also use code in the On Foramat event like:
Code:
Cancel = Forms!frmYourForm!chkShowLevel4Footer


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
I found this in a google group and then I saw dhookom's suggestion and it works perfectly! I put this in the Report's open event. Thanks for all of your help!!
Code:
Me.GroupLevel(0).ControlSource = "=1"

Journeyman -- The Order of the Seekers of Truth and Penitence
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top