• Change Control Source in Report Detail Line (Access 2000 SR1)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Change Control Source in Report Detail Line (Access 2000 SR1)

    Author
    Topic
    #364652

    I am an Access VBA novice and have the following situation: I have a report bound to a query that contains page header, detail and report footer sections. After I print all of the detail lines, I need to print one final detail line containing several calculated fields. My original plan was to remove the control source of the detail line controls once I get to the Report Footer format event, put the computed fields in the newly unbound detail section controls and then to call the Detail_Format and Detail_Print subs one more time — all this from the Report_footer format event. I am unable to remove the control source from the detail line controls. I receive a message stating “You can’t set the RecordSource property once printing has started”.

    Can someone please tell me what I am doing wrong or, better yet, please suggest an alternative solution to my problem. Thanks.

    Viewing 1 reply thread
    Author
    Replies
    • #560537

      What are you attempting to calculate? You may have to build a seperate query to calculate the results needed.

      RDH

      • #560539

        Ricky:

        Thanks for the reply.

        I could build a second query but where do I change the report RecordSource to the second query?

        • #560541

          Not exactly sure what you are doing or wanting. But you would not change the Record Source for the Report, you would include the query with the needed results in the current Recordset that the Report in bound to.

          RDH

        • #560555

          In the report footer, create a subreport based on your second query

          • #560709

            Thanks for the reply. I had thought about the subreport approach but have ended up incorporating the data for the final detail line into the report’s RecordSource.

            I may try the subreport approach the next time! Thanks again.

    • #560552

      Why wouldn’t you print your calculated fields in the report footer? That’s usually the way it’s done unless you’re grouping the report and want to put something like group totals in a group footer.

      You’ll have to explain what you’re actually trying to *accomplish* in more detail instead of what you’re tryingt to do. Access has rather rigid ideas about what it will let you do to a report at runtime.

      • #560710

        Thank you for the reply.

        The report will ultimately be printed on a preprinted form. The data for the final detail line is a summary count of certain types of data. It needs to be printed as the last line of the detail section as there will be additional logic to print the footer starting at a fixed line on the form.

    Viewing 1 reply thread
    Reply To: Change Control Source in Report Detail Line (Access 2000 SR1)

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

    Your information: