Printing a message on a blank page of a report

T

Tony Williams

I have a report that includes a number of subreports. The last two pages
have a subreport which itself has a subreport. Is it possible to print on
these pages "There is no data for this quarter for this analysis on these
pages only if there is no data found in the subreports. I have tried putting
a message box in the OnNoData event but I don't get a message, however I
would prefer to print a message on the blank pages themselves as these will
be printed anyway because of information which I want printed on those pages
and which is contained in label controls.
Any ideas?
Thanks
Tony
 
A

Allen Browne

Test the HasData propery of the report in the subreport control:
=IIf([Sub1].[Report].[HasData], Null, "No data found")

Substitute your subreport control name for Sub1.
 
T

Tony Williams

Sorry for being slow Allen but where does this IIF statement go? I've tried
a number of places Like OnOpen etc but without any joy.
Thanks
Tony
Allen Browne said:
Test the HasData propery of the report in the subreport control:
=IIf([Sub1].[Report].[HasData], Null, "No data found")

Substitute your subreport control name for Sub1.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Tony Williams said:
I have a report that includes a number of subreports. The last two pages
have a subreport which itself has a subreport. Is it possible to print on
these pages "There is no data for this quarter for this analysis on these
pages only if there is no data found in the subreports. I have tried
putting a message box in the OnNoData event but I don't get a message,
however I would prefer to print a message on the blank pages themselves as
these will be printed anyway because of information which I want printed
on those pages and which is contained in label controls.
 
A

Allen Browne

Just type it into the Control Source of a text box on the main report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Tony Williams said:
Sorry for being slow Allen but where does this IIF statement go? I've
tried a number of places Like OnOpen etc but without any joy.
Thanks
Tony
Allen Browne said:
Test the HasData propery of the report in the subreport control:
=IIf([Sub1].[Report].[HasData], Null, "No data found")

Substitute your subreport control name for Sub1.

Tony Williams said:
I have a report that includes a number of subreports. The last two pages
have a subreport which itself has a subreport. Is it possible to print on
these pages "There is no data for this quarter for this analysis on these
pages only if there is no data found in the subreports. I have tried
putting a message box in the OnNoData event but I don't get a message,
however I would prefer to print a message on the blank pages themselves
as these will be printed anyway because of information which I want
printed on those pages and which is contained in label controls.
 
T

Tony Williams

Thanks Allen worked like a dream!
Cheers
Tony
Allen Browne said:
Just type it into the Control Source of a text box on the main report.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Tony Williams said:
Sorry for being slow Allen but where does this IIF statement go? I've
tried a number of places Like OnOpen etc but without any joy.
Thanks
Tony
Allen Browne said:
Test the HasData propery of the report in the subreport control:
=IIf([Sub1].[Report].[HasData], Null, "No data found")

Substitute your subreport control name for Sub1.

I have a report that includes a number of subreports. The last two pages
have a subreport which itself has a subreport. Is it possible to print
on these pages "There is no data for this quarter for this analysis on
these pages only if there is no data found in the subreports. I have
tried putting a message box in the OnNoData event but I don't get a
message, however I would prefer to print a message on the blank pages
themselves as these will be printed anyway because of information which
I want printed on those pages and which is contained in label controls.
 

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