Supressing a subreport

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report with three subreports in it. In some caes, I want to suppress
the printing of the last of them. If the three all print, I have "page 1 of
3" etc. What I want is to NOT include that last report, so that I only get
TWO pages.

Any ideas on how I can do that? (Access 2002)

Thanks!
 
Dennis:

First, set the height of each subreport to its minimum size (about .0007)
and set their can grow property to true. Then if you want to suppress the
printing of the last one you'd simply set its visible property to False.
E.g. Me!YourSubreport2Name.Visible = False. That way the third (and for
that matter 2nd and 1st report don't take up space if they are set to not be
visible. You can control this externally to the report by creating a
global variable in a general module something like

Global boolShowThirdSub as Boolean

Then if you have a form that controls the printing or previewing and you
don't want the third sub to show, set this variable to false from a command
button and in the report's On Open event, add code like
Me!YourSubreport2Name.Visible = boolShowThirdSub and in the report's on
Close event, always reset the variable by adding code like this:
boolShowThirdSub = True.

HTH
 

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

Back
Top