Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move a excel document to another location using Access

Status
Not open for further replies.

MadMax7

MIS
Feb 17, 2004
62
GB

Hope someone can help

I currently download some data extracts overnight into a location on my C drive, i need to know if there is a way on the timer event at 05:00 every morning i can move these files into another location using access

any ideas would be appreciated

 
If Access is open you can use the FileCopy() function passing in the file to be copied and then the files destination as arguements.

Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Look at the FileCopy statement in VB Help. I don't know of a way to move a file but with FileCopy and Kill statements you can achieve what you need.

Try using Scheduled Tasks from Control Panel to open the DB at 5am and have a form that runs your code. I haven't actually done this but it loks like it would work better than using a form's timer event because there are optons for waking the pc up to run the scheduled tasks.

I'd further recommend not coding the Kill statement but rather, set up a table that logs the name and path of the files you've copied and delete them manually once you know that everything's working.

HTH

John

Use what you have,
Learn what you can,
Create what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top