By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,963 Members | 1,841 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,963 IT Pros & Developers. It's quick & easy.

How to Duplicate Table Entries by a Quantity?

P: 4
This question is completely backwards, to what a database is suppose to do, however because of the interaction between two systems it needs to be this way. I am looking for some way to have a report display the information bellow.

I am simplifying the problem to what I am trying to accomplish. I need to have quantities be able to repeat an entry as many times as there are quantities.

OrderNumber, QTY, PartNumber
PO0001, 2, PN-01
PO0001, 1, PN-02
PO0001, 3, PN-06

Result needed or Output needed.
Unit A PO0001, PN-01
Unit B PO0001, PN-01
Unit C PO0001, PN-02
Unit D PO0001, PN-06
Unit E PO0001, PN-06
Unit F PO0001, PN-06

Does anyone have any ideas on how to accomplish this?
Thanks for the help.
Jul 1 '10 #1

Share this Question
Share on Google+
4 Replies


NeoPa
Expert Mod 15k+
P: 31,769
I would suggest this needs some VBA coding including a loop.

Open two recordsets and process through the first inputting the data. Next, or should I say after each individual record has been read from the first recordset, write out the data to the other recordset n times.

Access VBA DAO Recordset Loop Using Two Recordsets may help as a basic template for your code. Let us know how you get on with this.

Welcome to Bytes!
Jul 1 '10 #2

NeoPa
Expert Mod 15k+
P: 31,769
Trumped!

That's a better solution I would say.
Jul 2 '10 #4

P: 4
Ahhh that worked GREAT!!! Thanks!!!
Jul 7 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.