Handling No Data from Subreports

A

Andrew Hall

Can any one tell me how to report "no data" from a subreport to the main
report.

The "On No Data" in the subreport does not fire when the main report runs
The "On No Data" in the main wont fire because the data does not exist in
the main report anyway

The report I have has five subreports.

4 will almost always return data
1 will after not return data

this is correct according to the data set

when the one subreport that often returns no data does so it does not appear
on the main report leaving a space where it should be.

what I want to do is show some hidden text where the subreport should be to
indicate that the subreport has returned zero

The only way I have done this in the past is to use stored queries for the
subreports and to run them on main report load as well as through the
subreports.

The form load run of the query establishes the BOF value and shows or hides
hidden text as appropriate

This is very inefficient and there must be a better way of doing this.

Thanks to any one who has taken the trouble to read this

Andrew Hall
 
A

Allen Browne

Place a text box on the report, in the same section as the subreport.

Set its Control Source to something like this:
=IIf([Sub1].[Report].[HasData], Null, "Nuffin for this sub.")

Replace Sub1 with the name of your subreport contro.
 

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