Full Version: print a form to pdf
UtterAccess Forums > Microsoft® Access > Access Forms
I have cutePDF installed on my PC and i want to create a button that will allow me to print my form to the PDF writer and save it in a default location. I would like this to happen in the background if at all possible and for no prompts to appear. Any ideas?
Forms are not intended for printing. I suggest you create a form that contains the information andd print that instead. Reports can easily be printed to pdf.
ok thanks. So is it possible to print a report to PDF and save it to a default location but whilst making this happen in the background?
Yes, check out Stephen Lebans PrintotPDF example (freeware). You'll find his site on the links page.
There is. See here.
hats a very nice peice of code. Can you tell me how to change where the pdf defaults to saving to? At the moment it goes to the My Documents folder. I presume this possible but cant figure out where its set.
The location to where you want to save the pdf is part of the passed parameter to the function. It is optional so that is why it is saving to the my documents folder. The parameter is the 3rd one ( OutputPDFname as String). Leban's code is pretty easy to follow.
Hi guys,
One final things regarding this printing to PDF. Have you found that when you try to print a date field that it wont work?

The issue you may be having is that both the dynapdf.dll and StrStorage.dll files, according to the text instructions issued by Stephen Lebans, states that these file should be located in this directory C:\WINDOWS\system32.

When you down load from Stephen Lebans site the two file are with the zip file.

Edited by: kapeller on Thu May 8 8:16:53 EDT 2008.
Unfortunately this doesnt seem to the problem. If the field is empty it prints fine but if the field contains a date in the format 10/02/2008 then printing wont work. Text fields do not cause a problem.
I think its probably becasue im trying to print the date (12/12/2008) and use this as part of the file name and obviously windows doesntly like "/" in file names. So i will try to look at changing the date format
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.