Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.
    Carol W.

  2. #2
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

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

    RDH
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

  3. #3
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Ricky:

    Thanks for the reply.

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

  4. #4
    Star Lounger
    Join Date
    Dec 2001
    Location
    Birmingham, Alabama USA
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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
    Ricky Hicks
    Microsoft MVP
    Birmingham, Alabama USA

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

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

    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.
    Charlotte

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

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

  7. #7
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.
    Carol W.

  8. #8
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Nevada, USA
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.
    Carol W.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •