copy excel file from memory stick to C:\

109bow

Registered User.
Local time
Today, 08:44
Joined
Oct 24, 2007
Messages
134
I need to copy an excel spreadsheet from my memory stick, E:\, onto my hard drive. I will have a command button in a form that will run this code.
Would be grateful for any help as I have no idea where to start.
 
Thanks for your reply Ken. I have created a module using the copyfile command. How do I run this module from a command button on a form. please keep as simple as poss as I'm a novice to Access. Thanks
 
Post the code you have that you think will work and maybe some here can help to see if it looks like what you need and can suggest how to use it, I'm guessing you could run it from a button click event...
 
The code I have is;
Sub Copy_One_File()
FileCopy "A:\USB2.0FlashDisk_sda1\LATHE_DATA.xls", "F:\Victoria Line\Bombardier\Maintenance\Lifting Rd and Wheel Lathe Team Documents\Wheel Lathe Documents\Wheel Lathe backup\LATHE_DATA.xls"
End Sub
This code works when I run the module but I don't know how to run it from a form.
 
Open a form in design view, create a button on it. right click the button and do build event then code builder and put the code there.
 
Ken, thanks for your patience.
I have created the button, when I right click and select build event I am faced with a VBA page, where do I put my piece of code. Below is the code I am faced with;
Private Sub Command61_Click()
On Error GoTo Err_Command61_Click

Screen.PreviousControl.SetFocus
DoCmd.FindNext
Exit_Command61_Click:
Exit Sub
Err_Command61_Click:
MsgBox Err.Description
Resume Exit_Command61_Click

End Sub.

Many thanks, Ben
 
If you google videos for access vba code there are a lot of good examples. This will help more than I can via this forum dialog...
 

Users who are viewing this thread

Back
Top Bottom