Загрузить файл в поле с типом Вложение - Кнопкой в форме
Private Sub cmdTest02_Click()
Dim rs As DAO.Recordset
Dim rsFiles As DAO.Recordset
Dim sPath$
sPath = "d:\Temp\Book1.xlsx"
Me.Dirty = False
Set rs = Me.Recordset
rs.Edit
Set rsFiles = Me.Recordset.Fields("TestAttachment").Value
rsFiles.AddNew
rsFiles.Fields("FileData").LoadFromFile sPath
rsFiles.Update
rs.Update
rsFiles.Close
Set rsFiles = Nothing
rs.Close
Set rs = Nothing
End Sub
|