Make a subreport invisible if blank

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a subreport which just has one text box in it named
DateofJurisdiction. The Control Source is set to:

="Permanency Date: " & [PermanencyDate]

where [PermanencyDate] is a field in the query that the subreport is based
on. What I'd like to do is have this subreport not appear at all in the main
report unless there is a value for [PermanencyDate]. I have the following
code for the subreport:

Private Sub Report_NoData(Cancel As Integer)
Me.DateofJurisdiction.Visible = False
End Sub

I thought that this would make it invisible if there were no data... the
subreport still appears if there is data or not. Any ideas?

Thanks,
Tim
 
Change the property "can shrink" to true in the next sections
1. the sub report
2. the section where the sub report is
3. the field in the sub report
4. the section where the field is, in the sub report.
 
Got it, thanks!

Ofer said:
Change the property "can shrink" to true in the next sections
1. the sub report
2. the section where the sub report is
3. the field in the sub report
4. the section where the field is, in the sub report.

tminn said:
I have a subreport which just has one text box in it named
DateofJurisdiction. The Control Source is set to:

="Permanency Date: " & [PermanencyDate]

where [PermanencyDate] is a field in the query that the subreport is based
on. What I'd like to do is have this subreport not appear at all in the main
report unless there is a value for [PermanencyDate]. I have the following
code for the subreport:

Private Sub Report_NoData(Cancel As Integer)
Me.DateofJurisdiction.Visible = False
End Sub

I thought that this would make it invisible if there were no data... the
subreport still appears if there is data or not. Any ideas?

Thanks,
Tim
 
Back
Top