Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating Multiple Records From The Data In One? 1

Status
Not open for further replies.

BTilson

Programmer
Jul 14, 2004
139
US
Let's say I have a record in one table of this:
Code:
1 2 3
I need to figure out how to take this record, and in another table create individual records of:
Code:
1
2
3
Another example:

One record of:
Code:
3 18 23 45
Create in a new table these records:
Code:
3
18
23
45
I can see how this can be done in my head, but I can't for the life of me make it happen with code.

Does anyone have any suggestions?

Brooks Tilson
Database Development
Tilson Machine, Inc.
 
You can use split, if you have a suitable delimiter:

Code:
astrOut=Split(rsIn!Field1," ")

For i=0 To Ubound(astrOut)
   rsOut.AddNew
   rsOut!Field1=astrOut(i)
   rsOut.Update
Next

rsIn.MoveNext
 
Hey, that did it perfectly. Thank you very much!

Brooks Tilson
Database Development
Tilson Machine, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top