That link won't help with code. It might give a better understanding of what multi-value fields are.
I am starting to think that the only way to programmatically transfer Attachment items from one table to another is to:
1. Save the files from Table1 to a folder
2. Add the files from folder to Table2
3. Delete the files from the folder
This article has code for saving and adding attachments http://blogs.office.com/b/microsoft-...cess-2007.aspx
I do find it odd that the sample code uses .Value property which seems to contradict what I thought about the Attachment field type not having this property.
Edit: FOUND IT!!! http://www.access-programmers.co.uk/...d.php?t=180349
This uses ADO recordset so need to set Reference in the VBA editor to Microsoft ActiveX Data Objects 2.8 Library. Tables have to be in same project. I give up trying to programmatically connect to other database. I set a link to the other table then this code works on the two tables. Change name Table2 to the linked table name.
Code:
Sub TransferAttachments()
Dim rstFrom As ADODB.Recordset
Dim rstTo As ADODB.Recordset
Dim rstMVF As ADODB.Recordset
Dim rstMVT As ADODB.Recordset
Set rstFrom = New ADODB.Recordset
rstFrom.Open "Table1", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Set rstTo = New ADODB.Recordset
rstTo.Open "Table2", CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Do While rstFrom.EOF = False
rstTo.AddNew
Set rstMVF = rstFrom!Attach.Value 'Attach is the attachment datatype field
Set rstMVT = rstTo!Attach.Value
' Copy all the attachments in the field Attach (attachment datatype)
Do While rstMVF.EOF = False
rstMVT.AddNew
rstMVT!FileData = rstMVF!FileData
rstMVT!FileFlags = rstMVF!FileFlags
rstMVT!FileName = rstMVF!FileName
rstMVT!FileTimeStamp = rstMVF!FileTimeStamp
rstMVT!FileType = rstMVF!FileType
rstMVT!FileURL = rstMVF!FileURL
rstMVT.Update
rstMVF.MoveNext
Loop
Set rstMVF = Nothing
Set rstMVT = Nothing
rstTo.Update
rstFrom.MoveNext
Loop
rstFrom.Close
rstTo.Close
End Sub