Copy only Specified Files to Archive.mdb

A

Andy

Hi;

Using an Append qry to copy records from one mdb to another for archiving
when a Product has been discontinued.
The User selects the records to be archived by clicking "ArchiveYN" in a
frm.
The Append qry criteria = -1
That works correctly.

The mdb includes "External" pictures of the products. Meaning only the file
name is saved in the MDB not the image itself.

Using a variation of this code to display the image:
Me!txtProductName = "C:\CurrentProducts\" & [txtProductName] & ".jpg"
Me!txtImageNote = DisplayImage(Me!ImageFrame, Me!txtProductName)
That also works correctly.

Have learned this method which copies ALL of the jpg files:
Dim fs As Object
Dim oldPath As String, newPath As String
oldPath = "C:\CurrentProducts" 'Folder containing CurrentProducts
newPath = "C:\ArchivedProducts" 'Folder to copy files to
Set fs = CreateObject("Scripting.FileSystemObject")
fs.CopyFile oldPath & "\" & "*.jpg", newPath & "\" & "" Set fs = Nothing

What is missing is a way to copy ONLY the Archived jpg files from the
directory containing the "C:\CurrentProducts" to "C:\ArchivedProducts" and
not all of the files in the "C:\CurrentProducts" folder.

Have searched for the answer and nothing found over these last few days fits
this need exactly.

Would someone be so kind and point me in the right direction?

Thank You for taking the time to read this post.

Andy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top