msoFileDialogFilePicker will allow the user to select a file rather than a folder, so that is good. And you have the result stored in your string variable, strFileOrigin. This is good too.
Now you need to copy and paste your file that is identified in strFileOrigin. The main problem I see is that you do not know the file name or extension type chosen by the user. You could parse the name and extension from strFileOrigin. Alternatively, you could give the file your own name. The issue with naming the file is getting the correct extension type. So you could employ a filter to your FileDialog.
Let's start with some declarations to get the FileDialog created and then set its properties.
If you notice in the example I linked to, there is not a very obvious declaration
With Application.FileDialog(msoFileDialogFolderPicker)
the filesystem object is held in memory using With
So let's do it a little differently. Something like
Code:
Dim objDialog As FileDialog
Set objDialog = Application.FileDialog(msoFileDialogFilePicker)
objDialog.AllowMultiSelect = False
objDialog.Filters.Clear
objDialog.Filters.Add "Excel", "*.xlsx"
objDialog.Show
Now we have an object that will return a string. Let's make sure we have a bucket to store it in.
Code:
Dim strFileOrigin As String
strFileOrigin = ""
strFileOrigin = objDialog.SelectedItems(1)
Now we need to copy it and paste it into another folder. For this we will need a reference to the Microsoft Scripting Runtime.
Code:
'Create a full path and add the file name to the string
strFileDestination = "C:\Documents\Access Project\" & FolderID
If Dir(strFileDestination, vbDirectory) = "" Then
MkDir strFileDestination
End If
strFileDestination = strFileDestination & "\MyCopiedFile.xlsx"
'Now we can create a new file system object to copy the User selected file and paste it
'to the new folder we just made
Dim fso As New FileSystemObject
fso.CopyFile (strFileOrigin, strFileDestination, True) 'with overwrite existing file as true
See if you can test the above code and get it to work