Copying or Moving a Video (or any other kind) File from One Folder to Another

kyuball

Registered User.
Local time
Yesterday, 21:14
Joined
Jul 6, 2009
Messages
66
Hey everyone,

I have a database that keeps track of sketch comedy bits in Access 2003 .mdb format. Thanks to everyone's help here, it is a really bitching database that allows me to add information and watch those videos on a separate form. Now I want to take it one step further in helping me become a really lazy sack of you-know-what.

Presently, when I enter information about a file, I enter it through a form that allows me to watch the video through a WMP that I installed on the form so I know where to place the time markers. The way the video loads into the WMP player is through lines of code that I don't remember right now. Suffice it to say that when I enter the name of the video file (e.g. saturdaynightlives4e9.wmv) into a text box, the AfterUpdate event triggers the WMP to play the file (something like "play file = "C:\User\Desktop\" & Me.videofile".) So the work flow goes something like this:

1) I move the video file from a download folder to my desktop which acts like a holding room or such where I can go through the video and see if there are sketches I like within the file that is worth saving for future viewing.
2) After viewing the video, if there are sketches I like contained within, I enter information about the sketch (where on the video file it starts, where it ends, what I want to refer to it as [e.g. “Matthew Broderick Penis Sketch”], etc. etc.) and then save that information. If there are no sketches worth viewing again, I just delete the video file.
3) If I am keeping the file, I move it to another folder to keep for posterity and that is the folder that triggers the form that I watch the videos from (something like “play file = “C:\User\Desktop\Comedy\” & Me.videofile”)

What I would like to know is if there is a code (someone told me that there is a way to do this) that upon saving the information (I use the Mouse Trap that ghudson posted a while ago to keep records from saving until I press a command: http://www.access-programmers.co.uk/forums/showthread.php?t=38364&highlight=mouse+trap) will also copy the file from my desktop (I like having a holding room to work on files) to the folder where I keep video files I like (From C:\User\Desktop to C:\User\Desktop\Comedy.)

I understand that there may be some sort of Copy method or some such that will do this…
 
Here is code to copy files. Maybe it will help?
Code:
Sub Copy
Dim myObject as Object
Set myObject = CreateObject("Scripting.FileSystemObject")
Source = "SourcePathandFileHere" 
Dest = "DestPathandFileHere"
myObject.CopyFile Source, Dest
Set myObject = Nothing
End Sub
 
Oh my God, you're a genius, elliotgr! Made a few modifications, but it worked like a charm!!

The modifications below for those intending to use this in the future:

Code:
Private Sub Command0_Click()
 
Dim myObject as Object
Dim Source as String
Dim Dest as String
 
Set myObject = CreateObject("Scripting.FileSystemObject")
Source = "SourcePathandFileHere"
Dest = "DestPathandFileHere"
 
myObject.CopyFile Source, Dest
Set myObject = Nothing
 
End Sub
 

Users who are viewing this thread

Back
Top Bottom