Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I export an Acces report to a PDF file?

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
0
0
US
We have Adobe Acrobat writer. How can I export an Access report to it without user intervention?

Thanks ahead of time. They never have to knock if your door is always open.
 
I am working on this right now. I have a list of source codes, and I want a separate report for each code exported to a PDF. Here's where I am:

I have a form with a listbox listing all possible source codes. The listbox has two columns: Code, Description.

I have PDF Writer as my default printer.

I can pick a code from the list, and it will open the report, print it to the PDF writer, and provide the filename (from the description column), then send the enter key.

It uses the following code:

Dim varItem As Variant
Dim stDocName As String
stDocName = "rptAbstracts"
varItem = Me.lstSponsors.Column(1) & Chr(10)
SendKeys varItem, False
DoCmd.OpenReport stDocName, acNormal, , "[SponsorID] = " & Me.lstSponsors.Column(0)


Keep in mind, you have to have the PDF writer as the default printer.

Let me know if you ahve any questions.
Tim Gill
Gill Consulting
 
Hey Tim, How did you make out? They never have to knock if your door is always open.
 
It works just fine. In fact, I now have it so that it will run through the listbox and print out each one individually with no user intervention (other than pressing the "GO" button.

The code in the previous post will work to do them one at a time. If you want the new code that runs through the list, let me know.

Tim Gill
Gill Consulting
 
Are you still using the sendkeys option? They never have to knock if your door is always open.
 
Unfortunately, yes. It is the only way I have found to pass the name of the pdf file to be created. What I had to do was add a "pause" routine to wait long enough for the pdf writer to load and start processing. Once I got the right amount of paus time figured out, it worked like a charm.
Tim Gill
Gill Consulting
 
I'm using a control by Data Dynamics called Active Reports. Active Reports will export in Adobe PDF format. If you'd like, I can send you a report I created, or you can go to and d/l a trial copy.

It's pretty good for doing ad-hock reporting too. This is NOT a Crystal Reports look-alike, rather it's a control for Access, VB and the like.

Gary They never have to knock if your door is always open.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top