Hi all,
I've been looking into existing threads but I can't figure this out. I'm sure that this will be piece of cake for many of you.
I am trying to save the report into a Folder with the name of the CaseNr.
I can successfully create the folder, but I can't place the file inside it. The file is saved in "Claim Audit\Audit 2017" and it should be in "Claim Audit\Audit 2017\Me.CaseNo"
Thanks a lot in advance!!
I've been looking into existing threads but I can't figure this out. I'm sure that this will be piece of cake for many of you.
I am trying to save the report into a Folder with the name of the CaseNr.
I can successfully create the folder, but I can't place the file inside it. The file is saved in "Claim Audit\Audit 2017" and it should be in "Claim Audit\Audit 2017\Me.CaseNo"
Thanks a lot in advance!!
Code:
Dim FSO As Scripting.FileSystemObject
Set FSO = New Scripting.FileSystemObject
Dim FileName As String
Dim FilePath As String
Dim FolderName As String
Dim FP As String
FolderName = Me.CaseNo
FileName = Me.CaseNo & "-ClaimID" & Me.ClaimID & ".pdf"
FP = "Claim Audit\Audit 2017\"
FSO.CreateFolder (FP & "\" & FolderName)
FilePath = "Claim Audit\Audit 2017\" & FileName
DoCmd.OutputTo acOutputReport, "qryAuditSheetOut", acFormatPDF, FilePath
MsgBox "The Audit Sheet has been saved", vcinformation, "Save Confirmed"