Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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?

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

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

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

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

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

    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?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.

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

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

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

  6. #6
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    I send the attached database again.
    Attached Files Attached Files

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

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

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

  8. #8
    2 Star Lounger
    Join Date
    Feb 2002
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.

Posting Permissions

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