Results 1 to 10 of 10
  1. #1
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Limit Report to One Page (97 SR2)

    I have a report which refers in general to my entire database. However, because it is based on a very large query, the report itself is returning over 10,000 pages.

    The report is spawned by a button on a form, what can I add to the button's code to limit this report to one page?

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Limit Report to One Page (97 SR2)

    Have you considered using parameters to restrict the records returned for the report? I'm having a hard time envisioning a situation in which you always only want the 1st page out of 10,000 pages! Not sometimes the 2nd page, or even the last page, but the first page?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limit Report to One Page (97 SR2)

    What parameters might I use?

    I've developed the report to be a one page entity, this same singular page is repeating itself 10,000 times...

    Thanks!
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  4. #4
    3 Star Lounger
    Join Date
    Mar 2001
    Location
    Minneapolis, Minnesota, USA
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limit Report to One Page (97 SR2)

    Just to get my mind around it, you have, say, 25 records that are the result of the query and fit nicely on page 1 of 1. Unfortunately, page 1 of 1 prints 10000 times?

    Or is it page 1 of 10000?

    Two thoughts: (1) I've had a 1 page report jump to 2 pages due to a control that was situated past the right margin. But, 2 pages ain't 10000! (2) Perhaps the query itself is being run 10000 times for some reason. Just a simple query serving as the data source of the report?
    <font face="Comic Sans MS"><font color=blue>~Shane</font color=blue></font face=comic>

  5. #5
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limit Report to One Page (97 SR2)

    I'm with Shane on this one ... it's hard to grasp that the exact same page is repeated 10,000 times. The only time I have seen this happen (and not to this extent) was when a chart was involved.
    Might the query on which the report is based have more than one table in it? If so, are they linked properly or might you be looking at a cartesian product? Or possibly is there a portion of this that is an internal one-to-many relationship that is not being addressed properly? I apologize for belaboring the point, but is there anything different about these pages?

  6. #6
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Northern, California, USA
    Posts
    1,886
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limit Report to One Page (97 SR2)

    <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15> Not one chart, but 4... <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>

    Architecture aside, Is there a way to make the button preview only the first page of the report?
    <IMG SRC=http://www.wopr.com/w3tuserpics/Kel_sig.gif>
    Moderator:<font color=448800> Pix Place, Internet Explorer</font color=448800>
    <small>www.kvisions.com

  7. #7
    Star Lounger
    Join Date
    Sep 2001
    Location
    SC, USA
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limit Report to One Page (97 SR2)

    Try this two lines of code:

    DoCmd.SelectObject acReport, "ReportName", True
    DoCmd.PrintOut acPages, 1, 1
    <img src=/S/chatter.gif border=0 alt=chatter width=38 height=16>

  8. #8
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Limit Report to One Page (97 SR2)

    I don't know a way to do it in print preview, but if you want to print it:

    DoCmd.PrintOut [printrange][, pagefrom, pageto][, printquality][, copies][, collatecopies]

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

    Re: Limit Report to One Page (97 SR2)

    If the charts are not bound to the recordset underlying the report itself either through their data sources or in some other fashion, then you're getting a cartesian product resulting in the same report printing 4 * the number of records in the charts underlying recordsets at the very least.
    Charlotte

  10. #10
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Limit Report to One Page (97 SR2)

    >>I've developed the report to be a one page entity, this same singular page is repeating itself 10,000 times... <<

    This is just a guess, but I'd say you probably have an error here somewhere.

    You say you "developed the report to be a one page entity", meaning what exactly? Does it only show totals? or what? My guess is that your query has resulted in a cartesian join. This is what you get when you join 2 tables without a linking field; that is, each record in Table1 is linked with EVERY record in Table2.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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