Link to home
Start Free TrialLog in
Avatar of cheryl9063
cheryl9063Flag for United States of America

asked on

How to make a label dissapear based on subreport data in an Access database

PLease see rptSample on the attached sample database. I want the one lable on it to disappear if the subreport has no data in it.. The subreport is linked to the main report by employeeID..
Avatar of cheryl9063
cheryl9063
Flag of United States of America image

ASKER

woops forgot file!
Sample.mdb
Avatar of Jeffrey Coachman
Like was mentioned in your previous post...

I am still a bit confused as to the design of this report.
Does the report as it stand now give you what you want?

Something like this *should* work but I can't figure out how to test it in this case becaue of your design.

Private Sub PageFooterSection_Format(Cancel As Integer, FormatCount As Integer)
    If Me.qryVacation_subreport.Report.HasData Then
        Me.Label4.Visible = True
    Else
        Me.Label4.Visible = True
    End If
End Sub


I have enclosed a standard Main/Subreport to show how this is commonly done.
Which works perfectly as you have requested.
The report is called: rpt1Emps

Note that Employee "Sally" has no Sales, and the Label for the sub report is not visible.

JeffCoachman
Sample-2-.mdb.accdb.mdb
You are not still not understanding my request Jeff..The label I need to dissapear does not go with the subreport... OK lets use your example.. How do you make the label Sally dissappear? I still see Sally's name and I dont want to becuase she has no sales..
OK.. I recreated the subreport and now the label is attached to it.. I put the code in the report footer becuase this is where the subreport needs to be and it still does not hide the label.. Is there something else I need to do? PLEASE READ THE FOLLOWING:  Each emploee has 1 attendance report.. There are many employees so an employee pulls their name from a form and get their report, therefore the report is for 1 employee... Each employee has vacation days.. Some employees have both vacation days and late days.. If that employee has late days they need to see their vacation days on the report and the late days(in a subreport).. If an employee does not have late days they only see their vacation days.. The late days subreport would be empty and the late days label needs to be gone....
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
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