Hello,
i want to browse the files from a form and then store hem to the database.
i have the following code, i can show the file path to the text box but i don't know how to store the file or how to upload the file to the database.
can you help me please?
thank you
Dim f As Object
Dim strFile As String
Dim strFolder As String
Dim varItem As Variant
Set f = Application.FileDialog(3)
f.AllowMultiSelect = True
If f.Show Then
For Each varItem In f.SelectedItems
strFile = Dir(varItem)
strFolder = Left(varItem, Len(varItem) - Len(strFile))
'MsgBox "Folder: " & strFolder & vbCrLf & _
'"File: " & strFile
Me.Text6.Value = strFolder & "\" & strFile
Next
End If
Set f = Nothing
i want to browse the files from a form and then store hem to the database.
i have the following code, i can show the file path to the text box but i don't know how to store the file or how to upload the file to the database.
can you help me please?
thank you
Dim f As Object
Dim strFile As String
Dim strFolder As String
Dim varItem As Variant
Set f = Application.FileDialog(3)
f.AllowMultiSelect = True
If f.Show Then
For Each varItem In f.SelectedItems
strFile = Dir(varItem)
strFolder = Left(varItem, Len(varItem) - Len(strFile))
'MsgBox "Folder: " & strFolder & vbCrLf & _
'"File: " & strFile
Me.Text6.Value = strFolder & "\" & strFile
Next
End If
Set f = Nothing