First of all, I still can't quite understand the logic of the first section of code that testing file names against checkfile, but beyond that in the code looking for a file in the folder
For i = LBound(CheckFile) To UBound(CheckFile)
FileFound = Dir(MyPath & "\" & CheckFile(i))
You are using MyPath which is the first time this appears in the code, you do set a path but it is this line that I have modified
sDest = "C:\Users\A C\Downloads" ' will be changed to CurrentProject.path & MAXIMOExports
So I am not sure how the code will find anything, even though the code does not provide any Path not found error messages, which I would have thought it would but does give a file not found error.
OK, I have the code for finding the files in the desired directory, this finds files starting with the second item in my checklist BlankDB
CheckFile = Array("Experiment*.*", "BlankDB*.*", "*TESTPRIMARY*", "*TESTSECONDARY*", "*TESTALTERNATE*")
On Error GoTo errorcatch
'The following lines of code use a network path for the source file :
sDest = "C:\Users\A C\Downloads\" & CheckFile(1) ' will be changed to CurrentProject.path & MAXIMOExports
Dim ctr As Integer
ctr = 1
FileFound = Dir(sDest) ' Retrieving the first entry.
Do Until FileFound = "" ' Start the loop.
MsgBox ctr & " - " & FileFound
ctr = ctr + 1
FileFound = Dir() ' Getting next entry.
Loop
I am just using ctr to count the number of files found in the folder.
Is it possible to place the Checklist file names in an Access table with the first (master) file names, so that that the system knows which file to append to?