Microsoft ® Access ™ 2010 VBA Macro Programming Richard Shepherd New York Chicago San Francisco Lisbon London Madrid Mexico City Milan New Delhi San Juan Seoul.
Access 2007 DB - Below is the code to save a selected record reports to PDF. The result I wanted is to have all the selected record reports save to 1 pdf file. Problem - This code saves each report as an individual pdf. What am I missing to cause the pdf to be continuous report saving? I don't thick the PDF compiler in Access will allow this. You will probably have to create one report with these three reports using sub-reports. It looks like all reports all calling the same AuditDteID, so this should be fairly easy to do.
You can then change your code to just call the one report and output it to PDF. Private Sub btnPDFClick If AuditDteID = 0 Then MsgBox 'No audit has been selected' Exit Sub '. Kristina, first a note of thanks for identifying me in your original posting;) I have a report with up to 14 subreports, soyou should be able to breach the mark of 10. The alternate option, if you have access to it, is using Acrobat coding. If you have the full blown version, the code is actually fairly simple to combine all the individual outputs into one. If not, I believe there may be some alternate libraries that you can use to combine them as well. I have used a couple that we use more for editting a PDFs, but might also have that functionality.
My first suggestion would be to try and build your report into one large report with multiple subs. If you come across limitations, you might try grouping similar reports into unique subreports, i.e.
Reports a,b,c are subreport 1 to your master, reports d,e,f are subreport 2 to your master, etc. This somewhat turns it into an outline breakout. Then you master could have the overall details of your Audit Date, with your parent/child relationship on AuditDteID = AuditDteID. If you can't get that to work and you don't have access to Acrobat, let me know, and I can try to track down some of those libraries. Justin also suggested the 1 report with subreports.having some issues getting the record sections in each subreport to work.page breaks?
Grouping I have not tried.or learned yet. I did not know about coding in Adobe Acrobat. I have Adobe Acrobat 9 Standard but never looked into the coding aspect plus just starting to learn VBA. I will continue to try the subreports challenge with 22 subreports and 1 master.I will respond in a couple of days if I was successful. Thank you for responding. Here is an example we have here: Private Sub btnBuildClick Dim strFinalPath As String Dim strFinalFile As String Dim rst As DAO.Recordset Dim strSourcePath As String Dim intCover As Integer Dim x As Long Dim y As Long Dim oAdobe As Acrobat.CAcroApp Dim oPDF2 As Acrobat.CAcroPDDoc Dim oPDF1 As Acrobat.CAcroPDDoc Dim strFooter As String Dim strCover As String Dim strCover2 As String If MsgBox('Are you sure you are ready to build this presentation?'
, vbYesNo + vbQuestion, 'BUILD PRESENTATION') = vbNo Then Exit Sub strSourcePath = 'I: Presentation ' strFinalPath = 'J: Presentations ' Set rst = CodeDb.OpenRecordset('SELECT a.PRPagePath, a.PRPageDesc FROM tblPRPages a INNER JOIN tblPRPresentationPages b ON a.PRPageID = b.PRPageID WHERE b.PRPresID =' & Me.frmPRPresList!PRPresID & ' ORDER BY b.PRPresPagesOrder', dbOpenDynaset, dbSeeChanges) If rst.BOF And rst.EOF Then MsgBox 'You have no pages loaded for this presentation.' What I am doing is looping through a list of selected objects that are already in PDF that appear in a subform. My reports are not already in PDF format and being a beginner, this is a complex code to understand. Can the sourcepath be a control button ie. Print (which prints all the selected record reports without preview). The print button's source is a combo box field to select the record then when you click 'print', the selected record wth 23 reports will print.here's the print button 'On Click' code. Then below that is the combo box 'After Update' code.
I had the same issue about a year ago that I left alone due to the lack of finding a reasonable solution. My goal was to (using vba) open several reports and merge them into one pdf file, but using the outputto function converts each report to separate pdf files, which then requires more complex code to merge the separate pdf files. Adobe version 8.0 and higher includes an Access Addin that enables users to convert multiple reports into one pdf file with the click of a button, but what would be ideal is to figure out how Adobe is coding this action through the Distiller and somehow implement/call this action through vba.