Salve buongiorno ho trovato questo codice:
Private Sub btnAttachFiles_Click()
'Requires reference to Microsoft Office 16.0 Object Library (change your reference to the library based on your microsoft office version).
Dim fDialog As Office.FileDialog
Dim strPath As String
Dim varFile As Variant
Dim strInsertSQL As String
'Set up the File Dialog.
Set fDialog = Application.FileDialog(msoFileDialogFilePicker)
With fDialog
.AllowMultiSelect = True
.InitialFileName = CurrentProject.Path
.Title = "Please select one or more files"
.Show
'loop through the selected files
For Each varFile In .SelectedItems
'insert the file paths into the table
strInsertSQL = "INSERT INTO CustomerFiles (CustomerID,FilePath) VALUES ('" & Me.CustomerID & "','" & varFile & "')"
CurrentDb.Execute strInsertSQL
Next
End With
'show the results in the subform
[frmCustomerFiles_Sub].Form.Requery
Set fDialog = Nothing
End Sub
Cliccando sul pulsante “Attach files” qual'e' il codice che ti permette di copiare un file all'interno di una cartella C:\allegati
Grazie