Results 1 to 13 of 13
  1. #1
    Join Date
    Nov 2004
    Posts
    64

    Exclamation Unanswered: Print multiple copies automaticaly

    Hi all, I have a fairly simple question... I think?
    I have an inventory database that I use for keep track of stock. When the goods arrive I enter them on to the system, ie: kettle, x10 etc. I have a label that has the kettle information ie: supplier etc that prints out which I stick on the box.
    How can I print out 10 labels based on the qty I have entered in to my database? I know I could print out 10 labels but can access do this for me?

    Many thanks,

  2. #2
    Join Date
    Nov 2005
    Posts
    49
    Why not just run that print command twice? I mean your obviously running it once if your printing one company. So why not enter in that command 10 times?

    I know this isn't much of a solution but it would work, I think. <<---newbie to Access, still trying to get my simple question fixed.

  3. #3
    Join Date
    Nov 2004
    Posts
    64
    Yes I could do that but the main reason I can't use that solution is that different products come in with different quantities.
    There must be some kind of command/code thats like, DoCmd.OpenReport stDocName, acNormal x [qty]. can you see what I'm gettin at?

    Thinking a bit more, if I printed a report could I get access to ask me "How many copies i wanted" and do it all with code?

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi Franki

    Option a:
    Code:
     
    Dim i as Integer
    Dim j as Integer
     
    i = DLookup("MyQuantity", "MyTable")' CHeck DLookup in help to see if you need to add furether criteria
     
    For j = 1 to i
     
    DoCmd.OpenReport stDocName, acNormal 
     
    Next j
    Option b would be to replace the DLookup with i = Inputbox("How many reports?")

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Nov 2004
    Posts
    64

    Thumbs up

    Excellent! Thanks for your time.

  6. #6
    Join Date
    Nov 2004
    Posts
    64
    I'm back again searching for another answer in relation to the above. The above worked perfectly when I only had single products booked in, but when I booked multiple products in on a continuous subform, only the top record printed out. See below:
    AutoNum Product QtyReceived
    1 Kettle 20
    2 Toaster 15
    etc....etc....

    I would like to print 20 kettle labels and 15 toaster labels with the click of a button.

    Any Ideas how I can amend the code to print both records?
    Thanks.

  7. #7
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Post your current actual code so we can see where the data is coming from, which report gets called etc...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  8. #8
    Join Date
    Nov 2004
    Posts
    64
    This is the code on the Labels Button which is on a form called GoodsReceivedDetail.

    Private Sub Command203_DblClick(Cancel As Integer)
    Dim i As Integer
    Dim j As Integer
    Dim stDocName As String
    i = DLookup("[Qty]", "Products")
    For j = 1 To i
    stDocName = "ProductLabel1"
    DoCmd.OpenReport stDocName, acNormal
    Next j
    End Sub

    This is the statement that the Report `ProductLabel1` is looking at:

    SELECT Products.TurndullCode, Products.ProductDesc, Products.AMID, Products.SUPPLIER, Products.ProductAutoId, Products.SupplierModelId, Products.Image
    FROM Products
    WHERE (((Products.ProductAutoId)=[Forms]![GoodsReceivedDetail]![ProductID]));

    Think thats it.
    Ta

  9. #9
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    How is products structured?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  10. #10
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi Franki

    In addition check out DLookup in help. It returns one value (the first it comes across) therefore your final solution is going to require something entering for the third argument of DLookup as you require the value for each item.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  11. #11
    Join Date
    Nov 2004
    Posts
    64
    Think Ive sorted it,
    Thanks Guys.

  12. #12
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by Franki
    Think Ive sorted it,
    Thanks Guys.
    Super - why not post your code for posterity?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  13. #13
    Join Date
    Jul 2010
    Location
    scotland
    Posts
    1
    Yes, please, would be cool if you shared. It annoys the hell out of me when people figure it out and don't share :-(

Posting Permissions

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