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

Hide several fields as a group within a report?

Status
Not open for further replies.

SamDemon

Technical User
May 28, 2003
171
0
0
GB
Is it possible to hide several report fields as a group depending on a status rather than doing it with each one indiviually. i.e.

Private Sub Detail_Format (Cancel as Integer, FormatCount As Integer)
If me.Status = "First Status" then
me.infantno.visible = False
me.infantname.visible = False
End If
End Sub

What i would like is to group all the infant details into one group, called something like InfantGroupDetail and then just be able to code

Private Sub Detail_Format (Cancel as Integer, FormatCount As Integer)
If me.status ="First Status" then
me.infantgroupdetail.visible = False
EndIf
End Sub


Thanks in advance

Sam

It's just common sense, shame sense isn't common!
 
When you say "group", do you mean a report Group? Because a Group can be hidden, a sub report can also be hidden. Finally, you can add a Tag to the fields you want to hide, or name them as above, and loop through the controls:
Code:
For Each ctl In Me.Detail.Controls
If ctl.Tag = "Infant" Then
   ctl.Visible = False
End If
Next
 
How would you set up a report group. When I have tried to group fields with report I can not assign the group a name and therefore have been unable to call it in my code

If you could let me know how you can create the groups it would be very much appreciated.

Kind Regards

Sam

It's just common sense, shame sense isn't common!
 
Access assign names such as GroupHeader0 to Groups, so you can say:
[tt]Me.GroupHeader0.Visible = False[/tt]
Or:
[tt]Me.Detail.Visible = False[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top