Hi. I am using the following code to try to save a word document from the Field1 field,
which is an attachment field to "My Documents"
On the line where I have put "ERROR HERE" the code falls over saying "Invalid field data type"
Dim MYDOC_DIR As String
MYDOC_DIR = Environ("userprofile") & "\my documents"
Dim DB As Database
Dim rs As DAO.Recordset
Dim rsField1 As DAO.Recordset2
Set DB = CurrentDb
' Instantiate the parent recordset.
Set rs = DB.OpenRecordset("Attachments")
' … Code to move to desired employee
' Instantiate the child recordset.
Set rsField1 = rs.Fields("Field1").Value 'the Field1 field holds the attachments
' Loop through the attachments.
While Not rs.EOF
' Save current attachment to disk in the "My Documents" folder.
rs.Fields("Field1").SaveToFile MYDOC_DIR 'ERROR HERE