• sub form on a Report

    Author
    Topic
    #458357

    I have a subform on my report that does not apply to all customers. How do I make it invisible and remove the space allowed for it, if it does not apply?

    Viewing 2 reply threads
    Author
    Replies
    • #1152351

      I have a subform on my report that does not apply to all customers. How do I make it invisible and remove the space allowed for it, if it does not apply?

      Set the Can Shrink property of the subreport control on the main report to Yes, and do the same for the section that contains the subreport.

    • #1152393

      The subform is in the footer section (QuoteGroupName footer). The properties for the footer and subform are set at Can Grow and Can Shrink. Is there anything else that I should check?

      • #1152406

        The subform is in the footer section (QuoteGroupName footer). The properties for the footer and subform are set at Can Grow and Can Shrink. Is there anything else that I should check?

        Make sure that Can Shrink has been set to Yes for both the group footer section and the subreport.
        There shouldn’t be other controls that overlap horizontally with the subreport control; for example, there shouldn’t be a label next to the subreport.

        • #1152428

          Make sure that Can Shrink has been set to Yes for both the group footer section and the subreport.
          There shouldn’t be other controls that overlap horizontally with the subreport control; for example, there shouldn’t be a label next to the subreport.

          I’ve checked and from what you’ve indicated this should be working fine. I took my access class a few years ago and I recall the instructor cautioning us that if when someone (in my case the IT dept) installs the software, they need to make sure that the old version of access is completely wiped away. Could that be the case here? I don’t remember how to check that but could that create a problem with something like this? I have unbound images on the report that randomly appear and disappear when pushing it to an Adobe PDF. My coworker has to do all of the printing because I never know if the logo’s are going to “stick” or not!

          Horizonally, the subform goes from margin to margin with nothing next to it at all. There are several subforms both above and below it.

          • #1152433

            … they need to make sure that the old version of access is completely wiped away. Could that be the case here? I don’t remember how to check that but could that create a problem with something like this?

            I don’t think that would cause problems with Can Shrink.

            Could you post a stripped down copy of your database? See [post=”401925″]post 401925[/post] for instructions.

    • #1152446

      I don’t know if my last attachment worked.

      I’ll try this again. Would you mind checking the properties on the logo’s for me because they only go over to the PDF on occassion. Sometimes they are there and sometimes they aren’t…

      Thanks

      • #1152491

        The subforms aren’t really empty – they do display a single record, but the field in some of the subform happens to be blank.

        I don’t see the need for all those subforms. You can include the fields in the record source of the main report.
        Since you want labels with the text boxes, you need a little bit of code.
        See the attached version:

        I have no idea why the logos wouldn’t appear in a PDF file.

        • #1153117

          The subforms aren’t really empty – they do display a single record, but the field in some of the subform happens to be blank.

          I don’t see the need for all those subforms. You can include the fields in the record source of the main report.
          Since you want labels with the text boxes, you need a little bit of code.
          See the attached version:

          I have no idea why the logos wouldn’t appear in a PDF file.

          Thank you for the reply. I wasn’t able to work on this last week. Sorry for the late reply. I hope you get this because I’m not quite sure how this new format works and have not been able to get the email reply to work myself.

          I had to add an additional freight term and I’m afraid I must be missing some of the code. I clicked on QuoteGroupName footer, went into the module and pasted what you had on the sample database. Added the additional term that I needed (QtyDiscount) and I’m stuck.

          This highlights in yellow:
          Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

          This is what I tried to add:
          Me.QtyDiscount.Visible = Not IsNull(Me.QtyDiscount)

          Is there code somewhere else that I missed? I noticed that your module had (General) and (Declarations) at the top.
          I’ve tried to adjust it to that but it keeps reverting back to GroupFooter(0) and Format.

          • #1153247

            Have you added a control named QtyDiscount to the group footer? If there is a control bound to QtyDiscount but whose name is different (for example Text37), the code will fail – the code uses the Name property of the control.

            And is the name of your group footer GroupFooter0? If it has a different name, you should use that instead of GroupFooter0.

            • #1153684

              Have you added a control named QtyDiscount to the group footer? If there is a control bound to QtyDiscount but whose name is different (for example Text37), the code will fail – the code uses the Name property of the control.

              And is the name of your group footer GroupFooter0? If it has a different name, you should use that instead of GroupFooter0.

              My GroupFooter had a different name and I don’t get an error on QtyDiscount any longer BUT the fields and space allowed for the field don’t disappear when they are left blank. This is so frustrating. I think I have everything set as Can Grow/Can Shrink but I’m definitely missing something!

              (I had to put each term on a seperate table so they could track when the terms change and I didn’t know how to do that without breaking them out.)

              I’m attaching a new database. Any assistance you can offer will be appreciated.

              Thanks,
              Theresa

            • #1153686

              The name of the group footer *is* GroupFooter0 as you can see by selecting it and looking at the Other tab of the Properties window. So you should use

              Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

              instead of

              Private Sub QuoteGroupNameFooter_Format(Cancel As Integer, FormatCount As Integer)

            • #1153696

              The name of the group footer *is* GroupFooter0 as you can see by selecting it and looking at the Other tab of the Properties window. So you should use

              Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

              instead of

              Private Sub QuoteGroupNameFooter_Format(Cancel As Integer, FormatCount As Integer)

              Thank you. It’s working as expected now!

            • #1153691

              My GroupFooter had a different name and I don’t get an error on QtyDiscount any longer BUT the fields and space allowed for the field don’t disappear when they are left blank. This is so frustrating. I think I have everything set as Can Grow/Can Shrink but I’m definitely missing something!

              In addition of Hans’ answer, you should have [Event Procedure] in the On Format event of GoupFooter0. See attachment

            • #1153695

              In addition of Hans’ answer, you should have [Event Procedure] in the On Format event of GoupFooter0. See attachment

              THANK YOU!!! I was trying to compare the differences but missed that one!

    Viewing 2 reply threads
    Reply To: sub form on a Report

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: