Printing Reports, .PDF

jeaves79

New member
Local time
Today, 09:15
Joined
May 28, 2008
Messages
6
Ok, so I am a very novice user of Access and I have some ability to code in VBA, but not much.

A little background: I did not create this Database, I inherited it. This database is used to generate EPA documentation for thousands of requests a year. It imports the data from an excel sheet, and after the import is done, I click Print on the form and the printer prints out the documentation. I then Fax the paperwork to where it needs to go. This is time consuming and uses tons of paper.

I have 2 issues that I would like changed:

1. How can I have it print all 4 reports at once? Right now it treats the printing as 4 different print jobs, and the printer that I use puts an extra sheet inbetween the print jobs with the user name since multiple people use the printer.

2. When I click the print button, I want the report saved as a PDF file. I don't care if it opens a Save As dialog box, in fact I think I prefer it so that I can name it what I want and put the fine where it needs to go. But I don't know how to make the code work.

Here is what I have right now:

Private Sub PrintForms_Click()
If IsNull([ImportDataList]) Then
MsgBox ("Please select a shipment.")

Else
DoCmd.OpenReport "Rpt Fax Cover", , , "[Batch] = " & [ImportDataList]
DoCmd.OpenReport "TestEPAPage1"
DoCmd.OpenReport "TestEPAPage2"
DoCmd.OpenReport "Rpt EPA Datasheet", , , "[Batch] = " & [ImportDataList]

End If
End Sub

So how do I make it so that it will put all 4 reports into 1 PDF file? I am using Access 2007, and I have downloaded and installed the Add-in from Microsoft for PDF files, but I am not sure how to put the code in for this. I tried playing around with it and I was able to get the save as box to pop up and when I gave it a test name, it wanted to print 1000s of pages of just Rpt Fax Cover, because that is where I started to play with the code.

I am not sure how the "[Batch] = " & [ImportDataList] statement works, but I know that when the data is imported the shipping data is put in a table called Import Data, and the individual units that are being shipped on that shipment are put in a table called Units Imported.


If you are confused, I'm sorry, I'm trying to make this clear while not novel length. thanks for any help, it will definately be appreciated!
 
my view (and don't take this as gospel )

. How can I have it print all 4 reports at once? Right now it treats the printing as 4 different print jobs, and the printer that I use puts an extra sheet inbetween the print jobs with the user name since multiple people use the printer

why not make the 4 reports 1 report (i.e 1 main report and 3 sub reports)
if you are doing a print run then you can put spacer sheets in no problem (I would make these spacer sheets sepearate reports in themselves

this also halfway answer your next request - you can get pdf reports to self name themselves -however as you are using A07- I would not be able to help - but check the samples for this I am sure some clever bunny has answered this already

best of luck
g
 
my view (and don't take this as gospel )

why not make the 4 reports 1 report (i.e 1 main report and 3 sub reports)
if you are doing a print run then you can put spacer sheets in no problem (I would make these spacer sheets sepearate reports in themselves

g

I do not know how to make the 1report with 3 sub reports, and I don't wnat the seperator sheets anymore.

I tried looking at the Lebans code for printing reports into a PDF and I am just confused by it.
 
jeeves79, i have noticed that you have had to post this topic a couple of times as no one seems to have a viable answer for you. I too have posted the same question before and have had no joy with a proper solution. Subsequently i would be a very happy lad if you found a solution. it seems that people are obsessed with main reports and subreports, i haven't been able to make this a clean process for my stuff yet either as i often have up to 20-25 individual reports that make up an overall report.

1 small solution i have had is to use a program called CutePDF, as it has an automated "Append" function. So i have a print run macro that opens the required report and prints it to the default CutePDF printer which then appends the printed report to the back of the last report, so the print run will print a cover page, followed by report 1 then report 2 etc etc. The report is then saved as a pdf after all the reports have been done.

There are some flaws with this though, such as regular print runs with pages out of order etc.

Anyway hope you have better luck than me.

Cheers
ndeans
 

Users who are viewing this thread

Back
Top Bottom