Here is my code
What i would like is for the output of the copy paste process to look at part of the file name not look for the whole name. For example at the moment it will look for "P12345" but if the file is called "P12345 test" it wont paste to that folder.
If you are worried about it finding more than one it wont as each "P" number is unique.
Thanks in advanced and i apologise in advanced if i havent made any sense
Code:
Function CreateWonJobFolders()
Dim fs, cf, QJobNum, pd
On Error Resume Next
If [Forms]![QTender Edit]![Won] = -1 Then
Msg = MsgBox("Create Project Folders?", vbYesNo, "Folder Creation")
If Msg = 6 Then '(yes)
QJobNum = [Forms]![QTender Edit]![QuoteNo]
JobNum = Right(QJobNum, 5)
Set fs = CreateObject("Scripting.FileSystemObject")
Set cf = fs.CopyFolder("P:\PROJECT TEMPLATE - COPY ONLY\*.*", "P:\P" & JobNum & "\")
End If
End If
End Function
What i would like is for the output of the copy paste process to look at part of the file name not look for the whole name. For example at the moment it will look for "P12345" but if the file is called "P12345 test" it wont paste to that folder.
If you are worried about it finding more than one it wont as each "P" number is unique.
Thanks in advanced and i apologise in advanced if i havent made any sense