Link to home
Start Free TrialLog in
Avatar of Alaska Cowboy
Alaska CowboyFlag for United States of America

asked on

How to hide subreport label if subreport has no data

I'm trying to hide the subreport label if there is no data in the subreport.

I've researched three solutions on EE and none seem to work for me.

the subreport is a thin line with "Can Grow", that part works great.

I put the label in the sub-report header but it displays every time even if there is no data.

I tried detail_format function also to no avail . . .

Then I tried
Private Sub Report_Current()

    If Me.rptPositionsByCandidate.Report.HasData = True Then
       
        Me.Candiate_Other.Visible = True
    Else
        Me.Candiate_Other.Visible = False
    End If

End Sub

from here , still no luck - the subreport label prints every time.

see attached, run the first report
Candidates-EE.accdb
SOLUTION
Avatar of Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Alaska Cowboy

ASKER

Thank you ThHiTechCoach, I will try it out tomorrow.

Jeff, thanks for the link
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> >><I'm trying to hide the subreport label if there is no data in the subreport.>
>>Actually it's a textbox...
- yes, good point, that was on purpose.

but the d.b. I just posted shows this:

User generated image
Thanks a lot, will pick it up tomorrow :-)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I couldn't get the suggestion to work, but I've seen the same thing in other questions.