Using VBA to create new folder & transfer files ? (1 Viewer)

liamfitz

Registered User.
Local time
Today, 08:17
Joined
May 17, 2012
Messages
240
The following code , SHOULD create a new folder, and then transfer ALL files in the old folder to the new one ...
Code:
Do While fdr <> ""
               tempStr = fdr
               If tempStr <> "" Then
                  OldPathName = strRootFolder & rst!Forename & "_" & rst!Surname & "_" & theDOB & "\" & rst!Referral_ID & "\" & tempStr & ""
                  NewPathName = strRootFolder & rst!Forename & "_" & rst!Surname & "_" & theDOB & "\" & refid & "\" & tempStr & ""
                  Name OldPathName As NewPathName
                  fdr = Dir
               End If
               tempStr = ""
           Loop
However, I get an error 'File not found', when I know it does, and the 'Pathnames' appear to be correct. Any suggestions, gratefully received.:confused:
 

liamfitz

Registered User.
Local time
Today, 08:17
Joined
May 17, 2012
Messages
240
Problem solved. Just changed code a bit - works a treat. Thanks.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom