J
Josie
I am trying to copy any files, from 1 folder, whose names
commence with a 7 digit reference number on the form,
into a 2nd folder.
At filecopy I get a message Run time error 53 - file not
found.
Thanks in advance
Josie
Dim FromDir As String, ToDir As String
Dim Source As String, Target As String
Dim strFName As String
strFName = Left(Forms!Test![Ref], 7)
ToDir = DLookup("PropertyPath", "MyFirm") & "\" &
Forms!Property![txtRef]
FromDir = DLookup("PhotoPath", "MyFirm")
Source = Dir(FromDir & "\" & strFName & "*.jpg")
MsgBox Source - File name & folder OK
Target = ToDir & "\" & Source
MsgBox Target - File name & folder OK
Do While Source <> ""
FileCopy Source, Target
Source = Dir()
Loop
commence with a 7 digit reference number on the form,
into a 2nd folder.
At filecopy I get a message Run time error 53 - file not
found.
Thanks in advance
Josie
Dim FromDir As String, ToDir As String
Dim Source As String, Target As String
Dim strFName As String
strFName = Left(Forms!Test![Ref], 7)
ToDir = DLookup("PropertyPath", "MyFirm") & "\" &
Forms!Property![txtRef]
FromDir = DLookup("PhotoPath", "MyFirm")
Source = Dir(FromDir & "\" & strFName & "*.jpg")
MsgBox Source - File name & folder OK
Target = ToDir & "\" & Source
MsgBox Target - File name & folder OK
Do While Source <> ""
FileCopy Source, Target
Source = Dir()
Loop