where the source data is imported to tSrcTable,
something like:
Code:
Public Sub ParseChilds()
Dim rst, vQry
Dim sSql As String
Set rst = CurrentDb.OpenRecordset("select * from tSrcTable")
DoCmd.SetWarnings False
With rst
While Not .EOF
vPar = .Fields("parent").Value & ""
vLine = .Fields("child").Value & ""
i = InStr(vLine, ",")
While i > 0
vChild = Left(vLine, i - 1)
vLine = Mid(vLine, i + 1)
GoSub Add1Child
i = InStr(vLine, ",")
Wend
vChild = vLine
GoSub Add1Child
.MoveNext
Wend
DoCmd.SetWarnings true
Exit Sub
Add1Child:
sSql = "insert into tTargTable (PARENT,CHILD) VALUES ('" & vPar & "','" & vChild & "')"
DoCmd.RunSQL sSql
Return
End With
Set rst = Nothing
Debug.Print "----done"
End Sub