On Jul 31, 7:15*am, George <Geo...@discussions.microsoft.com> wrote:
> Dear friends, need your valuable help,
>
> Case1:
> within an access database I store the filelocation, e.g.
> C:\folder1\photo1.jpg, C:\Anotherfolder\subfolder1\movie.mpg... etc
>
> Using a query I select some of those records (containing the primary key of
> each file, its location, etc.
> I need to run a code in order to copy those selected records/files from the
> query and copy them into C:\SelectedFiles, after deleting every single file
> located there.
>
> Case2:
> Using the same structure of the above database I have all files stored in
> C:\folder2 and I need, as above to copy some of those files into another
> folder (using the same procedure as described above).
>
> How can I accomplish those tasks?
>
> Thanking you so much in advance,
>
> GeorgeCY
You didn't mention do you need code for above or just idea?
Idea, case 1:
Code VBA to open recordset based on your query and loop through
records. Use command FileCopy(source, destination) to copy images. Use
command Kill(PathName) to delete files.
Case 2:
See case 1

without using Kill command.
Regards,
Branislav Mihaljev
Microsoft Access MVP