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

How do you make group headers not visible 1

Status
Not open for further replies.

BH

Programmer
Oct 15, 2002
76
GB
What I am trying to do is generate a report (named reportselection) from what is selected on a form. I have put the information required into group headers on a report. On the report I would like to hide or show group headers depending on what has been selected on the form.

I have tried to do this by using the section property i.e.
Reports!ReportSelection.Section(5).Visible, on the OnOpen event on the report but I keep getting an error message that says 'microsoft access can't find the field 'section' referred to in your expression.

Can anyone tell me how to hide the group headers or is there a better way of generating a data defined report.

Thanks to anyone who can offer some advice.

BH
 
This will hide or show the first group header if "YourField" = "YourValue".

Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
If Me.YourField = "YourValue" Then
Me.GroupHeader0.Visible = true
Else
Me.GroupHeader0.Visible = false
End If
End Sub

HTH,
Eric
 
hi luceze

Thanks for that. That works spot on!

I have now adapted the code so that when an option is selected on a form it hides or displays the information on the report as desired.

Big thanks again

Definately deserves a star!

BH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top