I wanted to ask any of you out there for some advice on how I am going about this.
I am taking two tables, family and children, where a family can have many children.
I need to create a new table identical to the family table (with all of it's fields), and just add a new column called childNames, which will be a csv of all their children.
The main reason I'm asking for help is the way I have done it so far takes about 26-32 seconds, which I would like to trim down (though it seems like much longer).
Now for the code:
after I create the table, and add the column...
So basically, I am wondering if anybody out there might have a better idea for this than me.
Thank you all for your help!
-Bauer
I am taking two tables, family and children, where a family can have many children.
I need to create a new table identical to the family table (with all of it's fields), and just add a new column called childNames, which will be a csv of all their children.
The main reason I'm asking for help is the way I have done it so far takes about 26-32 seconds, which I would like to trim down (though it seems like much longer).
Now for the code:
after I create the table, and add the column...
Code:
[COLOR=green]'childrenNames is the table I just created[/COLOR]
Set rs = db.OpenRecordset("childrenNames")
[COLOR=blue]Do While Not[/COLOR] rs.EOF
currentFamilyID = rs("ID").Value
[COLOR=blue]Set[/COLOR] rsChild = db.OpenRecordset("SELECT FirstName FROM Children WHERE ID=" & currentFamilyID)
childNames = ""
[COLOR=blue]Do While Not[/COLOR] rsChild.EOF
childNames = childNames & ", " & rsChild("FirstName")
rsChild.MoveNext
[COLOR=blue]Loop[/COLOR]
childNames = Right(childNames, Len(camperNames) - 2)
rs.Edit
rs("First Names") = childNames
rs.Update
rs.MoveNext
[COLOR=blue]Loop[/COLOR]
Thank you all for your help!
-Bauer