Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Re: print multiple copies of records (mailing labels) based on a f

Discussion in 'Information Technology' started by Lele, Jul 28, 2006.

  1. Lele

    Lele
    Expand Collapse
    Guest

    Hello,
    I am a manufacturer looking to print work tickets that reflect the quantity
    of items on an order. For example if an order lists 3 pillows and 2
    bedskirts, I need to produce 5 tickets. The code created by Graham in this
    post works great;

    --
    Lele


    "Graham Mandeno" wrote:

    > Hi WC
    >
    > A report has a NextRecord property which is normally set to True, but you
    > can request that the current record be reprinted by setting it to False.
    >
    > So, here's the trick: Add a textbox bound to the QTY field to the detail
    > section of your report. (If you don't want to print QTY then set its
    > Visible property to False). Now add the following code to your report's
    > module:
    >
    > ============================================
    > Dim iCopiesPrinted As Integer
    >
    > Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    > If FormatCount = 1 Then iCopiesPrinted = 0
    > iCopiesPrinted = iCopiesPrinted + 1
    > If iCopiesPrinted < QTY Then Me.NextRecord = False
    > End Sub
    >
    > Private Sub Report_Page()
    > iCopiesPrinted = iCopiesPrinted - 1
    > End Sub
    > ============================================
    >
    > What this does is:
    >
    > 1. Reset iCopiesPrinted to 0 if this is the first copy of this label
    >
    > 2. Increment iCopiesPrinted for the current label
    >
    > 3. If the required number of copies (QTY) have not yet been printed then
    > suppress moving to the next record.
    >
    > 4. Finally, if we are starting a new page then reduce iCopiesPrinted by one.
    > This is because the Format event happens twice at a page break - once to
    > ascertain that the section won't fit on the old page and again to format it
    > for the new page.
    >
    > --
    > Good Luck!
    >
    > Graham Mandeno [Access MVP]
    > Auckland, New Zealand
    >
    > "WCDukes" <WCDukes@discussions.microsoft.com> wrote in message
    > news:69812B6A-7AFD-46FB-9A01-A57A0E2C8692@microsoft.com...
    > >I am setting up a Purchase Order database that stores part numbers in an
    > > order form. Depending on the QTY ordered for each part number I need to
    > > print a certain number of mailing labels with that part number information
    > > on
    > > it.
    > >
    > > For example, an order has
    > > 1) QTY = 300 of Part A
    > > 2) QTY = 200 of Part B
    > >
    > > Depending on the case packs (information stored in the part number table),
    > > I
    > > need to print out a certain number of mailing labels. In this case it may
    > > be
    > > 600 labels for Part A and 500 Labels for Part B.
    > >
    > > Any suggestions?

    >
    >
    >
     
  2. Loading...

    Similar Threads Forum Date
    Footprints Of Guru Nanak In Sri Lanka History of Sikhism May 27, 2016
    Sikhism Preserving the Sikh heritage in Print Sikh Sikhi Sikhism Jan 12, 2016
    Guru Nanak's Foot-Prints in Baghdad's Sands Blogs Oct 22, 2015
    My Story Printed in Sikh Review Sept 2015 Issue Convert's Corner Oct 19, 2015
    Sakhis In The Footprints Of Guru Nanak... Redeeming Noorshah-the Magical Woman Of Kamroop History of Sikhism Mar 18, 2015

Share This Page