controlling the appearance of data

G

G.

I have a main report with 3 sub reports in it. Each sub report is based on a
query. If there is no data on a particular person in one of the 3 subreport
queries, the subreport contents do not show up on the main report - and vice
versa. This is what I want.

My question is how can I get the space where the subreport contents usually
shows up to just say something like "No Data Available" if that is the case?
Thank you.
 
M

Marshall Barton

G. said:
I have a main report with 3 sub reports in it. Each sub report is based on a
query. If there is no data on a particular person in one of the 3 subreport
queries, the subreport contents do not show up on the main report - and vice
versa. This is what I want.

My question is how can I get the space where the subreport contents usually
shows up to just say something like "No Data Available" if that is the case?
Thank you.


Create a label control (named lblrpt1) and place it in
subreport1's area. Set its Caption to whatever you want.

Then add a line of code to the section's Format event
procedure:
Me.lblrpt1.Visible = Not Me.subreport1.Report.HasData

Trpeat for the other subreports.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top