Print Multiple Copies

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TDIOwa

    Print Multiple Copies

    I have a report printing form (Access 97) in which I print different
    reports from. I have added a combo box that selects the number of
    copies that I want to print. Here is the rub... The following is the
    syntax that I use. The only problem is that I have the Database
    window hidden at all times and when I hit the print command button the
    report prints but the Database window becomes visible.

    DoCmd.SelectObj ect acReport, "rptSuperBi ll-Blank", True
    DoCmd.PrintOut , , , , Me!cmbCopies


    I tried a work around using the following syntax but I not only print
    the report but the report printing form also.

    stDocName = "rptSuperBi ll-Blank"
    DoCmd.OpenRepor t stDocName, acNormal
    DoCmd.PrintOut , , , , Me!cmbCopies

    My goal is to be able to print "X" amount of copies and keep the form
    that I am using from printing and the Database window hidden.

    Any help is appreciated. Thank you in advance,

    TD
  • fredg

    #2
    Re: Print Multiple Copies

    On 25 Oct 2004 10:00:43 -0700, TDIOwa wrote:
    [color=blue]
    > I have a report printing form (Access 97) in which I print different
    > reports from. I have added a combo box that selects the number of
    > copies that I want to print. Here is the rub... The following is the
    > syntax that I use. The only problem is that I have the Database
    > window hidden at all times and when I hit the print command button the
    > report prints but the Database window becomes visible.
    >
    > DoCmd.SelectObj ect acReport, "rptSuperBi ll-Blank", True
    > DoCmd.PrintOut , , , , Me!cmbCopies
    >
    > I tried a work around using the following syntax but I not only print
    > the report but the report printing form also.
    >
    > stDocName = "rptSuperBi ll-Blank"
    > DoCmd.OpenRepor t stDocName, acNormal
    > DoCmd.PrintOut , , , , Me!cmbCopies
    >
    > My goal is to be able to print "X" amount of copies and keep the form
    > that I am using from printing and the Database window hidden.
    >
    > Any help is appreciated. Thank you in advance,
    >
    > TD[/color]

    Try it this way.

    DoCmd.OpenRepor t "rptSuperBi ll-Blank", acViewPreview
    DoCmd.SelectObj ect acReport, "rptSuperBi ll-Blank", False
    DoCmd.PrintOut , , , , Me!cmbCopies
    DoCmd.Close acReport, "rptSuperBi ll-Blank" ' This line is optional
    --
    Fred
    Please only reply to this newsgroup.
    I do not reply to personal email.

    Comment

    • Tom Dean

      #3
      Re: Print Multiple Copies

      Bingo Award!!!

      Thanks Fred!!!

      TD

      *** Sent via Developersdex http://www.developersdex.com ***
      Don't just participate in USENET...get rewarded for it!

      Comment

      • Wayne Gillespie

        #4
        Re: Print Multiple Copies

        On 25 Oct 2004 10:00:43 -0700, tdiowa@hotmail. com (TDIOwa) wrote:
        [color=blue]
        >I have a report printing form (Access 97) in which I print different
        >reports from. I have added a combo box that selects the number of
        >copies that I want to print. Here is the rub... The following is the
        >syntax that I use. The only problem is that I have the Database
        >window hidden at all times and when I hit the print command button the
        >report prints but the Database window becomes visible.
        >
        >DoCmd.SelectOb ject acReport, "rptSuperBi ll-Blank", True
        >DoCmd.PrintO ut , , , , Me!cmbCopies
        >
        >
        >I tried a work around using the following syntax but I not only print
        >the report but the report printing form also.
        >
        >stDocName = "rptSuperBi ll-Blank"
        >DoCmd.OpenRepo rt stDocName, acNormal
        >DoCmd.PrintO ut , , , , Me!cmbCopies
        >
        >My goal is to be able to print "X" amount of copies and keep the form
        >that I am using from printing and the Database window hidden.
        >
        >Any help is appreciated. Thank you in advance,
        >
        >TD[/color]

        A simple work around.
        Create a table called something like tblNoOfCopies. Include a single field in the table as the Primary Key.
        Include this table in the recordsource of the report with no joins to any other table.
        From your selection form, before printing the report, have some code that clears tblNoOfCopies and then adds one record
        for each copy required. eg if yoy want 5 copies, add five records to tblNoOfCopies.

        When the report is run the recordsource will not be able to determine a link between tblNoOfCopies and the other
        table(s) in the recordsource and so it will return one identical record for each record in tblNoOfCopies. Giving you the
        desired number of copies printed.

        No need to use the PrintOut method at all.

        Wayne Gillespie
        Gosford NSW Australia

        Comment

        Working...