R
rfuscjr via AccessMonster.com
Alex was kind enough to point me toward this nifty little function but I am
stuck on sytax...I get an Expected array on this: (" & rstCCs!id &....portion.
..
Dim db As Database
Set db = CurrentDb
Dim rst As Recordset
Dim strSqlStmnt As String
Dim qdf As QueryDef
Dim rstCCs As DAO.Recordset
Dim rstTemp As DAO.Recordset
Dim blRet As Boolean
Dim I As Integer
Dim a As String
Set qdf = db.CreateQueryDef("")
DoCmd.SetWarnings False
Set rstCCs = db.OpenRecordset("ztest", dbOpenTable)
Set rstTemp = db.OpenRecordset("ztest2", dbOpenTable)
With rstCCs
.MoveFirst
Do Until rstCCs.EOF
a = Split(rst!FSC_LIST, "^")
For I = 0 To (a)
strSqlStmnt = "INSERT INTO ztest2 ( id, listitem, sequence ) Values("
& rstCCs!id & "," & a(I) & "," & I & ")"
qdf.SQL = strSqlStmnt
qdf.ODBCTimeout = 0
qdf.Execute
Next I
.MoveNext
Loop
End With
rstCCs.Close
MsgBox "Done!"
DoCmd.SetWarnings True
stuck on sytax...I get an Expected array on this: (" & rstCCs!id &....portion.
..
Dim db As Database
Set db = CurrentDb
Dim rst As Recordset
Dim strSqlStmnt As String
Dim qdf As QueryDef
Dim rstCCs As DAO.Recordset
Dim rstTemp As DAO.Recordset
Dim blRet As Boolean
Dim I As Integer
Dim a As String
Set qdf = db.CreateQueryDef("")
DoCmd.SetWarnings False
Set rstCCs = db.OpenRecordset("ztest", dbOpenTable)
Set rstTemp = db.OpenRecordset("ztest2", dbOpenTable)
With rstCCs
.MoveFirst
Do Until rstCCs.EOF
a = Split(rst!FSC_LIST, "^")
For I = 0 To (a)
strSqlStmnt = "INSERT INTO ztest2 ( id, listitem, sequence ) Values("
& rstCCs!id & "," & a(I) & "," & I & ")"
qdf.SQL = strSqlStmnt
qdf.ODBCTimeout = 0
qdf.Execute
Next I
.MoveNext
Loop
End With
rstCCs.Close
MsgBox "Done!"
DoCmd.SetWarnings True