Print Multiple Records to One PDF

thenman

Registered User.
Local time
Today, 13:15
Joined
Aug 29, 2009
Messages
23
Ok so here is the skinny...

I have a form that I need to print multiple times, but to one file such as a PDF or XPS (ideally the file-type is up to the user).

I need to be able to print it as a form, I can't use the same information in a report because of a function that only works in the form.

I just need to be pointed in the right direction. I have looked into a number of options such as using PDFCreator, but I plan to distribute the program, and even though it is "open source" there are restrictions on redistribution.

I have the microsoft PDF plugin installed, and using this would be ideal.

What I would like to see is something that caches each "printed" document and then takes the entire cache and uses DoCmd.OutputTo to parse it to one file.


Thanks for the help
 
Last edited:
The Microsoft pdf plugin is not available for printing forms, only reports. It might not even be available at all with only Access RunTime installed.

You need to make your function to work in the Report. Presumably you have it as a Private in a form module. It should be Public and placed in a Standard Module where it will be accessible throughout the project.
 
I never tried using the PDF plugin to print the form... I didn't realize that it couldn't be done with that. I have been using it to save a report that prints after my envelopes have printed.

Thanks for the input. Like I said though, as far as I can tell there is no way to make this print as a report. The form is set up to print envelopes with handwritten fonts. Each character on the envelope is a random selection from 5 fonts. Without getting into too much detail about the form, I haven't found a way to do the same thing to a report. Unless there is a way to copy and paste RTF from each "envelope" (record) in the form to a report I don't see it working.

Thanks again for the input though, I appreciate the quick reply.
 
Last edited:
so can this be done with the microsoft XPS then?
 
I just checked if the DoCmd.OutputTo works with a form and it does. This is what I meant when I said "Print", sorry for the confusion. So, lets find a way to make this work. Is there a way to store each instance of this form in some sort of cache or spool and then output the entire spool/cache to a singe file? I know that I can do this with Adobe Acrobat (using the insertpage command), but from what I understand you need the full version to build PDFs from VBA. I could also send the files to a word document (which may be a last resort). If I use word, I insert each envelope as a new page. I have no way of knowing if the end user will even have Word installed, or Acrobat or anything else for that matter.

Ideally the solution would be flexible enough that the user can choose the file type they prefer. Which is why I imagine everything being "cached" somewhere first and then the user can choose the file type, and then the DoCmd.OutPut will use this as the output file type.

Another possible solution is to print all of the documents to single files (which I can do now) and the combine them all somehow.

All of these I can imagine but can't execute. If someone has the know how, turn me on to how I can or might do it and I should be able to take it from there. I don't need any hand holding per se, just the proper way to execute it.

thanks again everyone
 
Last edited:
I have the Office 2007 XPS/PDF plugin on my XP SP3 computer. I can save Word and Excel to XPS or PDF and print a report to PDF from the Ribbon. However I only have the XPS printer included in my list of printers. I don't know how it could be used to make a PDF from a form in VBA.

In fact I don't even know how to use VBA to print a report as a PDF using the plugin. I use the CutePDF printer.

You can put a form inside a subform control on a Report. I have used this to display Datasheet views in a report but I guess it could be used for single forms. However I suspect it would not track the Master Child Links in a useful way. Worth a try though.

If no success there, check out the OnPrint event of the report. Maybe you could use this to advance the subform record before each report record is printed.
 
Now the spam is really getting sophisticated. They quoted me and then used a line taken from another thread to simulate their input. And signature SPAM in French.

Reported.
 

Users who are viewing this thread

Back
Top Bottom