Search for and upload a file to a specific location using a command button (1 Viewer)

awade

Registered User.
Local time
Today, 20:44
Joined
Apr 21, 2013
Messages
101
Good Afternoon All,

I would like to create a form that allows me to search for a folder on my desk top, then once located i can transfer that file to a specific location on another drive, Similar to the Browse / upload function you see on many applications.

I am using Access 2003. Is this possible??

Thanks in advance

awade
 

llkhoutx

Registered User.
Local time
Today, 05:44
Joined
Feb 26, 2001
Messages
4,018
Use the widely avaiable "common dialog" code to search for a file or folder via a button.
 

awade

Registered User.
Local time
Today, 20:44
Joined
Apr 21, 2013
Messages
101
Thanks IIkhoutx,

Im really new to all of this, would it be possible to explain or direct me to where i could fine this code.

Thanks
 

awade

Registered User.
Local time
Today, 20:44
Joined
Apr 21, 2013
Messages
101
I have found the attached form and this is exactly what I am after. (fBrowseDirectory)Thanks ghudson.

What I would like to do is have the import button send the file to a specific location on my drive - (S:\eDNA\admin\eDNA\Engine Data)

As im very new to writing and interpreting code, any assistance in this would be most appreciated.

Thanks in advance.

awade
 

Attachments

  • db1.zip
    53 KB · Views: 97

ghudson

Registered User.
Local time
Today, 06:44
Joined
Jun 8, 2002
Messages
6,195

awade

Registered User.
Local time
Today, 20:44
Joined
Apr 21, 2013
Messages
101
Good Afternoon All,

After some searching I have found a code that will transfer a folder from one drive to another.

I have put this code on a command button, and I still get an error message "The expression on click you entered as the event property setting produced the following error: Expected End sub"

Can someone please explain where the error is as I have been over the code numerous times and I can not see any error.

Is there also a way to have the results of the browse button I posted earlier to automatically be the FromPath in the code below.

Also is there a way to have the FromPath a Generic C:\User\Desktop so it can be used on any computer?

Thanks in advance.

awade

Private Sub Command0_Click()
Sub Copy_Folder()
Dim FSO As Object
Dim FromPath As String
Dim ToPath As String
FromPath = "C:\Users\Wadey\Desktop\Engine Data.zip"
ToPath = "S:\eDNA\admin\eDNA\Engine Data"
If Right(FromPath, 1) = "\" Then
FromPath = Left(FromPath, Len(FromPath) - 1)
End If
If Right(ToPath, 1) = "\" Then
ToPath = Left(ToPath, Len(ToPath) - 1)
End If
Set FSO = CreateObject("scripting.filesystemobject")
If FSO.FolderExists(FromPath) = False Then
MsgBox FromPath & "Does Not Exisit"
Exit Sub
End If
If FSO.FolderExists(ToPath) = True Then
MsgBox ToPath & "exisits, not Possible To Move To An Exisiting Folder"
Exit Sub
End If
FSO.MoveFolder Source:=FromPath, Destination:=ToPath
MsgBox "The Folder is moved from" & FromPath & " to " & ToPath
End Sub
 

Users who are viewing this thread

Top Bottom