this button click lets user pick the file, then it saves to your library...
Code:
private btnPickFile_click()
dim vFile, vTarg, f
dim I as integer
const kDIR = "\\server\folder\Documents\"
'have user pick the file
vFile = UserPick1File()
if vFile<> "" then
txtBoxPath = vFile 'save the path in the db tbl
'copy the file to the documents folder
i = InStrRev(psFilePath, "")
If i > 0 Then
vDir = Left$(psFilePath, i)
f = Mid$(psFilePath, i + 1)
else
exit sub
End If
vTarg = kdir & f
filecopy vFile, vTarg
endif
end sub
Public Function UserPick1File( Optional pvPath)
Dim strTable As String
Dim strfilepath As String
Dim sDialog As String, sDecr As String, sExt As String
If IsMissing(pvPath) Then pvPath = "c:"
With Application.FileDialog(msoFileDialogFilePicker) 'MUST ADD REFERENCE : Microsoft Office xx.0 Object Library
.AllowMultiSelect = False
.Title = "Locate a file to Import"
.ButtonName = "Import"
.Filters.Clear
.Filters.Add sDecr, sExt
.InitialFileName = pvPath
.InitialView = msoFileDialogViewList 'msoFileDialogViewThumbnail
If .Show = 0 Then
'There is a problem
Exit Function
End If
'Save the first file selected
UserPick1File = Trim(.SelectedItems(1))
End With
End Function