Hide subreport if it has no data

Catalina

Registered User.
Local time
Yesterday, 16:48
Joined
Feb 9, 2005
Messages
471
In Access 2010 I'm trying to hide a sub report in the Detail section if it has no data.

I found some possible solutions in this forum as well as on other sites.
Tried them all, and none of them work for me. The sub stays visible no matter what I do.
The set shrink to yes doesn't do anything either.

Any suggestions how to accomplish this?

Thanks.
 
Somehow I got it to work.
If I remembered what I did to make it work I would have posted it here.
 
that's soo wrong!!
 
Well, this works...

Code:
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As Integer)
On Error Resume Next
If Me.srpPOSpecialNotes.Report.HasData Then
Me.lblSpecialNote.Visible = True
Else
Me.lblSpecialNote.Visible = False
End If
End Sub

You can use variations to make subreports, text boxes, etc... visible or not.
 
Thanks Gina, I'll keep that code handy.

Catalina
 
I want that if the sub report has no data then it should not be displayed and at the same time the blank space which is generated by it should also be removed...

I am able to remove the subreport with no data with the above code but the blank space still persists...

Pls Help
 
HIMANSHU,

In the Section that contains the Subreport set the Can Shrink proprty to *Yes*.

Side Note: It's always better to start your own thread then attach your question to another thread. You have a better chance of getting answers that way!
 
Point taken Gina...thanks...started a new thread...
 

Users who are viewing this thread

Back
Top Bottom