cmdButton to Print 3 copies of record in Form view ?

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

    cmdButton to Print 3 copies of record in Form view ?

    cmdButton to Print 3 copies of record in Form view ?

    cmdButton will print 1 but I need 3 copies of the one Form record.


    --
    Dave Allison


  • Bob Quintal

    #2
    Re: cmdButton to Print 3 copies of record in Form view ?

    "David Allison" <david.allison@ zzzzzzzzzblueyo nder.co.uk> wrote
    in news:fLCmb.29$O 16.22@news-binary.blueyond er.co.uk:
    [color=blue]
    > cmdButton to Print 3 copies of record in Form view ?
    >
    > cmdButton will print 1 but I need 3 copies of the one Form
    > record.[/color]

    Open the form's code module and find the statement in your button's
    On Click event that starts with docmd..... Copy the line and paste
    it in twice.

    Bob Q

    Comment

    • Bruce M. Thompson

      #3
      Re: cmdButton to Print 3 copies of record in Form view ?

      > cmdButton to Print 3 copies of record in Form view ?[color=blue]
      >
      > cmdButton will print 1 but I need 3 copies of the one Form record.[/color]

      If you are opening a report to print the current record, you can use the
      following approach:

      '***EXAMPLE START
      Dim iCounter As Integer
      For iCounter = 1 To 3
      DoCmd.OpenRepor t "MyReport", , , "ID=" & Me.ID
      Next
      '***EXAMPLE END

      I usually provide a textbox in which the user can type in the desired number of
      copies (it always contains a "default" value) and retrieve that value for use in
      the code.

      If you are printing out the form (which I wouldn't normally recommend), you
      could use the "PrintOut" method of the "DoCmd" object which has a "Copies"
      parameter that will allow you to specify the number of copies. It is difficult,
      however, to filter the printout to one record unless it will always fit on one
      page.

      --
      Bruce M. Thompson, Microsoft Access MVP
      bthmpson@mvps.o rg (See the Access FAQ at http://www.mvps.org/access)[color=blue][color=green]
      >> NO Email Please. Keep all communications[/color][/color]
      within the newsgroups so that all might benefit.<<


      Comment

      • David Allison

        #4
        Re: cmdButton to Print 3 copies of record in Form view ?

        > > cmdButton to Print 3 copies of record in Form view ?[color=blue][color=green]
        > >
        > > cmdButton will print 1 but I need 3 copies of the one Form record.[/color]
        >
        > If you are opening a report to print the current record, you can use the
        > following approach:
        >
        > '***EXAMPLE START
        > Dim iCounter As Integer
        > For iCounter = 1 To 3
        > DoCmd.OpenRepor t "MyReport", , , "ID=" & Me.ID
        > Next
        > '***EXAMPLE END
        >
        > I usually provide a textbox in which the user can type in the desired[/color]
        number of[color=blue]
        > copies (it always contains a "default" value) and retrieve that value for[/color]
        use in[color=blue]
        > the code.
        >
        > If you are printing out the form (which I wouldn't normally recommend),[/color]
        you[color=blue]
        > could use the "PrintOut" method of the "DoCmd" object which has a "Copies"
        > parameter that will allow you to specify the number of copies. It is[/color]
        difficult,[color=blue]
        > however, to filter the printout to one record unless it will always fit on[/color]
        one[color=blue]
        > page.
        >
        > --
        > Bruce M. Thompson, Microsoft Access MVP[/color]

        Thanks Bruce though I wonder why ....[color=blue]
        > If you are printing out the form (which I wouldn't normally recommend)[/color]
        (Its a receipt - 3 copies)

        --
        Dave Allison ~ Scotland


        Comment

        • David Allison

          #5
          Re: cmdButton to Print 3 copies of record in Form view ?

          >[color=blue][color=green]
          > > cmdButton to Print 3 copies of record in Form view ?
          > >
          > > cmdButton will print 1 but I need 3 copies of the one Form
          > > record.[/color]
          >
          > Open the form's code module and find the statement in your button's
          > On Click event that starts with docmd..... Copy the line and paste
          > it in twice.
          >
          > Bob Q[/color]

          Thanks Bob ~ works a treat.

          --
          Dave Allison


          Comment

          • Bruce M. Thompson

            #6
            Re: cmdButton to Print 3 copies of record in Form view ?

            > Thanks Bruce though I wonder why ....[color=blue][color=green]
            > > If you are printing out the form (which I wouldn't normally recommend)[/color]
            > (Its a receipt - 3 copies)[/color]

            Most forms aren't formatted for printing (it's typical to find a gray color and
            3D textboxes and the like). I'm not saying that I make a point of recommending
            *against* printing a form; there's just more control in printing with a report -
            that's what a report is for.

            :-)
            --
            Bruce M. Thompson, Microsoft Access MVP
            bthmpson@mvps.o rg (See the Access FAQ at http://www.mvps.org/access)[color=blue][color=green]
            >> NO Email Please. Keep all communications[/color][/color]
            within the newsgroups so that all might benefit.<<


            Comment

            • David Allison

              #7
              Re: cmdButton to Print 3 copies of record in Form view ?

              > > Thanks Bruce though I wonder why ....[color=blue][color=green][color=darkred]
              > > > If you are printing out the form (which I wouldn't normally recommend)[/color]
              > > (Its a receipt - 3 copies)[/color]
              >
              > Most forms aren't formatted for printing (it's typical to find a gray[/color]
              color and[color=blue]
              > 3D textboxes and the like). I'm not saying that I make a point of[/color]
              recommending[color=blue]
              > *against* printing a form; there's just more control in printing with a[/color]
              report -[color=blue]
              > that's what a report is for.
              >[/color]

              OK thanks I have designed a prototype Form (no gray etc) but when it goes
              live I will look at making a report.
              The three receipts are for when a client books - data entry on the form -
              then print out the 3 copies of the form/receipt.

              Dave Allison
              [color=blue]
              > --
              > Bruce M. Thompson, Microsoft Access MVP
              > bthmpson@mvps.o rg (See the Access FAQ at http://www.mvps.org/access)[color=green][color=darkred]
              > >> NO Email Please. Keep all communications[/color][/color]
              > within the newsgroups so that all might benefit.<<
              >
              >[/color]


              Comment

              • Bruce M. Thompson

                #8
                Re: cmdButton to Print 3 copies of record in Form view ?

                > OK thanks I have designed a prototype Form (no gray etc) but when it goes[color=blue]
                > live I will look at making a report.[/color]

                When you're ready, you can save your form as a report and then tweak it from
                there. That's a great time saver.

                :-)
                --
                Bruce M. Thompson, Microsoft Access MVP
                bthmpson@mvps.o rg (See the Access FAQ at http://www.mvps.org/access)[color=blue][color=green]
                >> NO Email Please. Keep all communications[/color][/color]
                within the newsgroups so that all might benefit.<<


                Comment

                • David Allison

                  #9
                  Re: cmdButton to Print 3 copies of record in Form view ?

                  > > OK thanks I have designed a prototype Form (no gray etc) but when it
                  goes[color=blue][color=green]
                  > > live I will look at making a report.[/color]
                  >
                  > When you're ready, you can save your form as a report and then tweak it[/color]
                  from[color=blue]
                  > there. That's a great time saver.
                  >[/color]


                  Yup that works ! but problem is I have to print out (only) 3 copies of the
                  one record.
                  The form is designed as a booking/receipt form.

                  --
                  Dave Allison ~ Scotland


                  Comment

                  • Bruce M. Thompson

                    #10
                    Re: cmdButton to Print 3 copies of record in Form view ?

                    > Yup that works ! but problem is I have to print out (only) 3 copies of the[color=blue]
                    > one record.[/color]

                    Problem? Are you saying that the code I provided you with, which prints 3 copies
                    of the selected record, won't work for you? Remember, you would only be using
                    the report to print and only using the provided code.

                    --
                    Bruce M. Thompson, Microsoft Access MVP
                    bthmpson@mvps.o rg (See the Access FAQ at http://www.mvps.org/access)[color=blue][color=green]
                    >> NO Email Please. Keep all communications[/color][/color]
                    within the newsgroups so that all might benefit.<<


                    Comment

                    Working...