Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2010
    Location
    Europe for now
    Posts
    5

    Unanswered: Limit Lines in a subreport to print

    Hi, I have been helped before with a suggestion of using a subreport. this worked thanks. Now I have another problem. the main report is basically a 10 line form/template which is in the data section of the main report. In this main report is a detail section I added a subreport from a query to it. The main report determines what items by company will show in the subreport and all works fine until I go over the 9 line limit. the subreport grows and and the footer is on another page. I would like to limit the output to 9 lines and anything over that should print on the next page and next should there be more items. I have a total in the subreport that is also on the main report so this will need to change should there be more pages because I have a line total figure in the last column which totals at the end of the subreport in the footer. This total needs to show the total of each company no matter what the last page is. This also brings up page numbering. it is at the top right and should read Page 1 of ?? for that company. then page 1 of ?? for the next company. If you think you have a solution please let me know or if you need a sample file I can post or send it. If this has been done already and you know the link let me know I have searched every where on this subject. I am using Access 2003, I have 2007 but the people I send this to do not so I need to keep it in this format.

    thank you in advance Robert

    I need to have 9 lines no mater if populated with data or not, could be only one item or 25. thx
    Last edited by StillLearning; 12-14-10 at 18:49. Reason: Added additional information

  2. #2
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    Years ago I had a client that needed to do something similar. Their report output had several 'sections' that were x lines long. If there were x+1 lines then I had to have a second page with the same format as page one but with only the one line on the second page. It had to do this for about 10 different subsections.

    The only way I could figure out how to do it was to gather the data into a temporary table and then assign a page number to each record. In your case the first nine records would be page 1 and the next nine would be page 2, etc.

    The 'trick' is having the page number in the subreport and in the main report data. Then you can change the Link Master Fields property of the subreport to also link on the page number. For example, your main report data might look like:

    Company------OtherData-----Page
    CompanyA-----Something-----1
    CompanyB-----SomethingElse--2

    Then your subreport would have:

    Data--------Page
    Line1--------1
    Line2--------1
    Line3--------1
    Line4--------1
    .
    .
    .
    Line9--------1
    Line10-------2
    Line11-------2

    It worked, but there was some overhead assinging page numbers to the data. You might be able to calculate the page number in the data. I am not sure how to do that though.

  3. #3
    Join Date
    Nov 2010
    Location
    Europe for now
    Posts
    5
    thank you for your response. I will give it a try. I am not very good with access yet so I hope if I get stuck you may offer further assistance. I will also post the results should it work.

    thank you again

    Robert

Tags for this Thread

Posting Permissions

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