How to Not Print invisible Subreports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • VivDenham
    New Member
    • Dec 2008
    • 44

    How to Not Print invisible Subreports

    Hi

    I have a Report made up of 8 Subreports for Knitting Instructions for knitting Garment parts such as Body, Sleeves, Collar, Bands. However, some garments do not have a collar (i.e. a Vee Necked cardigan), so I don't want this subreport to print.

    I have made the Subreport invisible, but I still get a blank page where that subreport should appear.

    How do I tell it not to print the invisible subreport, and not to leave a space where that subreport would print if it were visible.

    I cannot use the Property for No Data, as there is data on the report (a field stating that the Collar Type = N/A, and an OLE picture of the Vee Band, showing why the Collar is Not Applicable). I just don't want to have to print that data.

    Many thanks for your ideas

    Viv.
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Easiest way is to make the height of the subreport as less as possible (just one line) than make sure the "CanGrow" property is set to "Yes" and you're in business :-)

    Nic;o)

    Comment

    • VivDenham
      New Member
      • Dec 2008
      • 44

      #3
      Thanks Nico - That works fine.

      However, as I am a complete beginner with VBA and am on a very steep learning curve, how would I tell it not to print the invisible subreport using code?

      Viv

      Comment

      • nico5038
        Recognized Expert Specialist
        • Nov 2006
        • 3080

        #4
        Hi Viv,

        Check out: http://bytes.com/topic/access/answer...b-report-blank
        Instead of the Null (or 0) code there you would need to check or the sub report's query doesn't return records.

        Nic;o)

        Comment

        • VivDenham
          New Member
          • Dec 2008
          • 44

          #5
          Thanks Nico. Could not get the code to run without the same Error Message as your last person. However, Report is now doing exactly as I want, not showing Subreports where there is no Collar or Bands.

          Thanks again.
          Viv

          Comment

          • nico5038
            Recognized Expert Specialist
            • Nov 2006
            • 3080

            #6
            Glad I could help, success with your application !

            Nic;o)

            Comment

            Working...