' 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. If as with an invoice you want the report to only print data for a specific customer you can replace the code in item 7 with the following: DoCmd.OpenReport rptCustomerInvoice, acViewPreview,, invoiceid & Me. StrPdfFile = " C:Users\BIlawalKhan\Desktop\\tempReportFolder\1.PDF|C:\Users\BIlawalKhan\Desktop\\tempReportFolder\2.PDF|C:\Users\BIlawalKhan\Desktop\\tempReportFolder\3.PDF" Set PDF = CreateObject( " PDFSplitMerge.PDFSplitMerge.1") This Access VBA Tutorial will discuss how to interact with Access Reports using VBA. Your report should now open in preview mode and automatically print. Loop ' DoCmd.OpenReport "Report", acViewPreview ' Dim adbApp As Acrobat.AcroApp Dim strPdfFile As String Dim PDF ' DoCmd.OpenReport "EmployeeCommission", acViewPreview ' Call WinClose(outputFileName) pdf"ĭoCmd.OutputTo acOutputReport, " EmployeeCommission", acFormatPDF, outputFileName, FalseĭoCmd.Close acReport, " EmployeeCommission", acSaveNo OutputFileName = CurrentProject.path & " \tempReportFolder" & " \" & x & ". ' Dim Document As Acrobat.CAcroPDDoc Dim avDoc As Acrobat.CAcroPDDocĭim x, y As Integer ' Set Document = CreateObject("AcroExch.PDDoc")įorms!CommisionCalculator!qryEmployee!Text178.value = EmpNo Set rs = CurrentDb.OpenRecordset( " SELECT * From ItemCommissionDefinitionGroupBy WHERE Delete = True") Dim outputFileName As String Dim rs As DAO.Recordset
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |