Hide a sub report with a button

WhiskyLima

Registered User.
Local time
Today, 09:17
Joined
Oct 8, 2013
Messages
48
Hi All! I have a report which shows a set of events. In this report each row has a sub report which show the guests that are attending. What I would like to do is to use a button to drill down into each individual event and hide it again on clicking the button (like a toggle button). I have used the following code which is attached to a button in the report (each event has a button)

Code:
If Me.GuestSubReport.Visible = True Then
    Me.GuestSubReport.Visible = False
Else
    Me.GuestSubReport.Visible = True
End If
I have used this in conjunction with the 'Can Grow' option and it works almost perfectly. The only problem is it shows or hides all sub reports at the same time instead of just the sub report in the given row.

Is there a way I can target the individual sub report when pressing the button?

Thanks guys!
 
sounds like your subreport is on a continuous report so the visible property is applied to all instances - and there is no way round that if that is the case.

You could try putting the subreport in the main report header or footer then using the linkchild/linkmaster properties to display the guests for each event as it is selected. You will need to provide more detail for a fuller explanation
 
Ok that's what I thought. To be honest I think it might be ok just to have one button to either show or hide all guests. Thank you for your help
 

Users who are viewing this thread

Back
Top Bottom