Refering to subreport control

D

Derek Brown

Hi All

How do you refer to a sub reports HasData property from a main form?

I am trying to hide either the report header on a main report or the header
of the subreport depending on wether the subreport HasData or not. When the
subreport has data the heading of the subreport needs to be visible. If
subreport has no data then the heading of the main report needs to be
visible.

On the main form and subform each heading only shows a text box with the day
and date. The
problem is I need to show one or the other depending on wether the subreport
has or has not got data.
 
D

Duane Hookom

I would place the main report controls behind the subreport control. Set the
subreport can shrink to yes. If the subreport doesn't have data, it won't
show and the controls on the main report will show.
 
D

Derek Brown

Thanks Duane

That works a treat!

The only remaining problem (and I think insurmountable) is still the fact
that I need to show a heading and a 3cm space below when the subreport has
no data. To do this I need to "Keep Together" the heading (main report) with
the space below or I often get a day heading right at the bottom of a page
and the space to hand write new appointments (as in a real diary) allocated
to the next page. If I keep the section together, then when there is data in
the subreport it keeps all the data in the subreport together and prints it
in one block on the next available page, leaving unsightly empty spaces in
between.
 

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