How multiply records in table or query

resurrection

New Member
Joined
May 27, 2002
Messages
11
Hallo,
I have table looking like this

CODE PRODUCTS PARTS NoPARTS
106 product1 part1 3
106 product1 part2 2


I need labels for each part of specific product, for exampel 106.
I wish in new table or query PRODUCTS and PARTS to be repeated with NoPARTS-time.

Like this

CODE PRODUCTS PARTS
106 product1 part1
106 product1 part1
106 product1 port1
106 product1 part2
106 product1 part2



I hope this is possible,
thanks.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
You need to crate a new table and run this code to add the old to the new.

Dim db As DAO.Database
Dim rstold As DAO.Recordset
dim rstnew as dao.recordset
dim intcount as integer
dim intcopy as integer

Set db = CurrentDb()
Set rstold = db.OpenRecordset("oldtable")
set rstnew = db.Openrecordset("newtable")

while not rstold.eof
intcopy = rstold("noParts")
intcount = 0
while intcount <= intcopy
rstnew.AddNew
rstnew("code") = rstold("code")
rstnew("products") = rstold("products")
rstnew("Parts") = rstold("products")
intcopy = intcount + 1

wend
rstold.movenext
wend
rstnew.Close
rstold.close

end sub

that the only way I can see so far.

good luck
 
Upvote 0

Forum statistics

Threads
1,221,844
Messages
6,162,346
Members
451,760
Latest member
samue Thon Ajaladin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top