Show empty subreport as placeholder (1 Viewer)

RedSkies

Registered User.
Local time
Yesterday, 22:45
Joined
Aug 17, 2000
Messages
48
I think I'm having a major brain fade or something but I can't figure this out. I've seen plenty of people asking how to get rid of the extra space left on a main report when a subreport has no data. That I can handle!

What I want to do this time is retain the space on the main report and maybe include some placeholder message such as "No data entered yet" for each subreport that has no data.

I originally had no labels attached to my subreports but tried attaching one and added this code to the Detail_format of the Main report:
Code:
If IsNull(Reports!SubReportName!SubReportKeyFieldName) Then
     Me.SubReportLabel.Visible = True
     Else
          Me.SubReportLabel.Visible = False
End if

But this generates an error saying the subreport is not open or doesn't exist.

Any suggestions?
TIA :)
 
Never mind!

I put this instead in the Detail_format of the Main report and it seems to work:
Code:
Me!UnattachedLabelName.Visible = Not (Me!SubreportName.Report.HasData)

The UnattachedLabelName control contains the text "No data entered yet"
 

Users who are viewing this thread

Back
Top Bottom