Hi,
I'm trying to open two recordsets (each from a different table) so that I can take the data from one and put it in the other, when it matches.
Essentially, I'm doing an outer join ... why you might ask? I need to take multiple records out of one table and concatenate fields from them into one field (one record) in the other table.
So what I want to do is this:
rst1.open select * from table1
while (not (rst1.eof)
stSql = "select * from table2 where keyField = '" & rst1("keyField" ) & "'"
rst2.open stSql
while (not (rst2.eof))
rst2("concatena tedField") = rst2("concatena tedField") & rst1("Field1") &...
rst2.movenext
wend
rst1.movenext
wend
rst1.close
rst2.close
unfortunately, "rst2.open stSql" is giving me trouble, because it says my object is already open.
thoughts?
thanks!
Lea Ann
I'm trying to open two recordsets (each from a different table) so that I can take the data from one and put it in the other, when it matches.
Essentially, I'm doing an outer join ... why you might ask? I need to take multiple records out of one table and concatenate fields from them into one field (one record) in the other table.
So what I want to do is this:
rst1.open select * from table1
while (not (rst1.eof)
stSql = "select * from table2 where keyField = '" & rst1("keyField" ) & "'"
rst2.open stSql
while (not (rst2.eof))
rst2("concatena tedField") = rst2("concatena tedField") & rst1("Field1") &...
rst2.movenext
wend
rst1.movenext
wend
rst1.close
rst2.close
unfortunately, "rst2.open stSql" is giving me trouble, because it says my object is already open.
thoughts?
thanks!
Lea Ann
Comment