Dim outputFileName As String Dim rs As DAO.Recordset Set rs = CurrentDb.OpenRecordset("SELECT * From ItemCommissionDefinitionGroupBy WHERE Delete = True") 'Dim Document As Acrobat.CAcroPDDoc Dim avDoc As Acrobat.CAcroPDDoc Dim x, y As Integer 'Set Document = CreateObject("AcroExch.PDDoc") x = 1 rs.MoveLast rs.MoveFirst EmpNo = "" y = rs.RecordCount Do While x <= y EmpNo = rs(0) Forms!CommisionCalculator!qryEmployee!Text178.value = EmpNo outputFileName = CurrentProject.path & "\tempReportFolder" & "\" & x & ".pdf" DoCmd.OutputTo acOutputReport, "EmployeeCommission", acFormatPDF, outputFileName, False DoCmd.Close acReport, "EmployeeCommission", acSaveNo 'DoCmd.OpenReport "EmployeeCommission", acViewPreview 'Call WinClose(outputFileName) x = x + 1 rs.MoveNext Loop 'DoCmd.OpenReport "Report", acViewPreview 'Dim adbApp As Acrobat.AcroApp Dim strPdfFile As String Dim PDF strPdfFile = "C:Users\BIlawalKhan\Desktop\[CommApp 5.3.15]\tempReportFolder\1.PDF|C:\Users\BIlawalKhan\Desktop\[CommApp 5.3.15]\tempReportFolder\2.PDF|C:\Users\BIlawalKhan\Desktop\[CommApp 5.3.15]\tempReportFolder\3.PDF" Set PDF = CreateObject("PDFSplitMerge.PDFSplitMerge.1") PDF.Merge strPdfFile, "c:\Report3.PDF" MsgBox "Success", vbInformation 'Merge them into a single PDF file 'Dim mergedDoc As PdfDocument = PdfDocument.Merge(doc1, doc2) 'Exit_Command30_Click: 'Exit Sub 'Err_Command30_Click: 'MsgBox Err.Description 'Resume Exit_Command30_Click
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)