Results 1 to 4 of 4
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287

    duplicate a record if the quantity is >1

    Hey guys,

    We have a program that gives a list of every item on our floors. We use this list to print labels and too inventory work. Here is a snip of what the query looks like:
    Click image for larger version. 

Name:	fifl.PNG 
Views:	18 
Size:	59.6 KB 
ID:	16189

    This data is pretty much pulled directly from our ODBC.

    If there is a an item with a quantity greater than 1, I need that record to be duplicated as many times as the quantity is over 1. I need an individual label for each peice. Make sense? The final table/query that gets exported needs to have all items have a quantity of one.

    I guess what I need is to do an append query that duplicated each record by an amount of quantity minus one. How can I do that?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    I have a situation where I also have to print variable number of labels. I use VBA to write records to a 'temp' table. These records are purged from the table after each process.

    It is also possible to trick Access into repeating a record when report is rendered. I do this to force report page to fill with blank rows. It's not easy to program and drove me nuts for a week before I got it to work. I tried to apply the technique to my label printing but my requirements are too complex.

    Here is a link to thread asking your question back in 2005 and looks like Allen Browne came to the rescue http://bytes.com/topic/access/answer...-repeat-record
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Interesting concept. I'll try it when I get back to the office on Monday. Thanks June7.

  4. #4
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Wow that was incredible amounts of simple. Worked like a charm. I appreciate it as always!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 03-09-2013, 10:39 AM
  2. Goto Record when Duplicate Record Exists
    By rlsublime in forum Programming
    Replies: 13
    Last Post: 03-22-2012, 03:46 PM
  3. Replies: 5
    Last Post: 03-02-2012, 08:58 PM
  4. Duplicate last record to next record in form
    By jdhaldane in forum Forms
    Replies: 4
    Last Post: 12-17-2010, 04:22 PM
  5. If duplicate record, go to original record
    By BigBear in forum Forms
    Replies: 2
    Last Post: 10-06-2010, 02:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums