• Limit Report to One Page (97 SR2)

    Author
    Topic
    #360304

    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!

    Viewing 2 reply threads
    Author
    Replies
    • #542297

      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?

      • #542300

        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!

        • #542306

          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?

        • #542374

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

    • #542327

      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?

      • #542342

        laugh Not one chart, but 4… dizzy

        Architecture aside, Is there a way to make the button preview only the first page of the report?

        • #542351

          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]

        • #542363

          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.

    • #542347

      Try this two lines of code:

      DoCmd.SelectObject acReport, “ReportName”, True
      DoCmd.PrintOut acPages, 1, 1
      chatter

    Viewing 2 reply threads
    Reply To: Limit Report to One Page (97 SR2)

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

    Your information: