Hello,
I am no expert and I am in the process of learning along the way. I am currently building a form that is intended to be used for submission of data and documentation by users. The information entered on the form will be saved to a temp table. I am trying to figure out how to create a button that will allow you to browse for files and place the files selected in the attachment field on my temp table. I have the button set up with the following code, but it is not working. I know storing actual attachments in the database itself is not the best, and I would preferably want to create a browse button to select a file, and then automatically save the selected file to a specific folder. Any help on both of these ideas is much appreciated.
Private Sub Command435_Click()
Call Selectfile
End Sub
Public Function Selectfile() As String
Dim Fd As FileDialog
Set Fd = Application.FileDialog(msoFileDialogFilePicker)
With Fd
.AllowMultiSelect = False
.Title = "Please Select File"
If Fd.Show = True Then
Selectfile = .SelectedItems(1)
Me.Attachments = Selectfile
Else
Exit Function
End If
Set Fd = Nothing
End With
End Function