this function splits a multi author field in a form into seperate fields and pastes them into an author table
what i am attemting to do is check in the author table to see if the author exsists if it does get the author_id and go to the next author, if it doesnt paste it in to the author table.
Private Sub Command44_Click()
Set Dbs = CurrentDb
Dim x As Variant
Dim i As Long
Dim luref As String
If [authors] <> Null Then
x = Split([authors], ":"
For i = 0 To UBound(x)
existluref = "DLookup([luref_id], tbllookups, [Data] = x(i))"
If existluref = Null Then
Set rst = Dbs.OpenRecordset("tbllookups"
rst.AddNew
rst![Data] = x(i)
rst![tpref_id] = "AUT"
rst.Update
rst.MoveLast
luref = rst![luref_id]
Set rst = Dbs.OpenRecordset("tbllink"
rst.AddNew
rst![bibref_id] = [bibref_id]
rst![tpref_id] = "AUT"
rst![luref_id] = luref
rst.Update
luref = rst![luref_id]
Else
luref = existluref
Set rst = Dbs.OpenRecordset("tbllink"
rst.AddNew
rst![bibref_id] = [bibref_id]
rst![tpref_id] = "AUT"
rst![luref_id] = luref
rst.Update
luref = rst![luref_id]
Next i
End Sub