Something like:
Code:
Dim rs AS DAO.Recordset, x As Integer, aryFruit As Variant
Set rs = CurrentDb.OpenRecordset("SELECT fieldname FROM tablename;")
rs.MoveFirst
While Not rs.EOF
aryFruit = Split(parsefruit(rs!fieldname), ",")
For x = 0 To UBound(aryFruit)
If IsNull(DLookup("Fruit", "FruitList", "Fruit='" & ary(x) & "'")) Then
CurrentDb.Execute "INSERT INTO FruitList(Fruit) VALUES('" & aryFruit(x) & "')"
End If
Next
Wend
Modify the parsefruit function to return a string without embedded spaces and quote marks - just comma separated values. Or eliminate that function:
aryFruit = Split(Replace(Replace(Replace(rs!fieldname, "-", ","), "/", ","), " ", ""), ",")