Welcome to SPN

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

Sign Up Now!
  1. Guest ji, please consider donating today!
      Become a Supporter    ::   Make a Contribution   
    Monthly Recurring Target: $300 :: Achieved: $95

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

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

  1. Lele

    Expand Collapse

    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;


    "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
    In The Footprints Of Guru Nanak- Fourth Journey In Punjab Sikh Sikhi Sikhism Dec 22, 2016
    In The Footprints Of Guru Nanak-Fourth Itinerary Sikh Sikhi Sikhism Dec 18, 2016
    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

Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     

Share This Page