• Preview printed 3 copies at a time (A2K SR-1)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Preview printed 3 copies at a time (A2K SR-1)

    Author
    Topic
    #377013

    I have this problem with my database for some time but it isn’t critical and I assumed it was an off-and-on thing and could be easily rectified. The problem is like this:
    I have a form which a print and a preview control to print or preview a single A2K report of one page, with all the report’s data within the margins allowed by the page size and intended printer. I can preview the report without problem. I can also print it when I press the print button – a page of report will be printed. However, when I preview the report and then print it from the print command in the file menu of A2K, three pages of the same report will be printed without fail. I checked my codes and the print setup, no where can I see the request to print 3 copies.

    I suppose the error is mine, but can anyone enlighten me where likely is my source of error?

    Viewing 1 reply thread
    Author
    Replies
    • #619768

      It’s merely a guess, but I suspect that your report is based on a query that returns multiple instances of a record. That may be because the query isn’t constructed properly or because the report itself has a problem. Without more information, all we can do is guess. Why don’t you try putting the report and queries into a database and zipping it up and attaching it to a post so we can take a look at it? Otherwise, you’ll have to post the SQL for the report’s recordsource before anyone can give you a more definitive answer.

      • #620373

        In trying to extract the portions of my program that prints the report, and then running the extracted database, I discovered a solution to my problem. In my codes, there is a command bar in the menu that print the active report using the code :

        DoCmd.PrintOut

        By default it prints all the pages in the report. I changed it to print only one page:

        DoCmd.PrintOut acPages, 1

        Now my program prints only a single page of the report. But I am still puzzled why DoCmd.PrintOut print out three pages of the same report. The error could be in my query or reports.

        I send the extracted database over (Print3.mdb) with some data in the table in case you need it. Sorry that most of the user’s codes are in the native language. The report is about statistics of students of different ethnicity in different classes and of different years of studies.

        • #620393

          If you attempted to attach the database, your attachment didn’t make it through. Don’t forget that you can’t preview or spellcheck after you have attached a file.

          • #620499

            I send the attached database again.

            • #620581

              I opened the database and printed the report both ways, but in each case it printed the full report once, which consisted of 2 pages.

            • #620672

              I felt a little embarrassed that you printed only once (1 or 2 pages depending on page setup I supposed). I tried it again and this is what I found:

              Set CBarCtl = CBar.Controls.Add(Type:=msoControlButton)
              With CBarCtl
              .Caption = “Cetak”
              .Style = msoButtonIcon
              .TooltipText = “Mencetak maklumat yang dipaparkan”
              (1) .OnAction = “=CetakLapor()”
              (2) ‘ .OnAction = “=DoCmd.PrintOut”
              .FaceId = 4
              End With

              Function CetakLapor()
              (3) DoCmd.PrintOut acPages, 1
              (4) ‘ DoCmd PrintOut
              End Function

              If I use line (1) and disable line (2), the printer only prints once irrespective of whether line (3) or line (4) is used.
              If I disable line (1) and activate line (2), then the printer would print the report 3 times. Why?

              My sincere thanks for looking into my codes, Charlotte.

    • #619876

      Just to clarify, if you preview the report, it only displayes 1 page (even if you try, you can’t see any more pages)? If you Print the report from your form, it also only prints 1 page; but if you Preview, then use Access Print from Menu, it prints 3 pages?

      What does the code look like in your form that launches both Preview and Print? And when you select File | Print while Previewing, it only says it will print 1 copy?

    Viewing 1 reply thread
    Reply To: Preview printed 3 copies at a time (A2K SR-1)

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

    Your information: