Creating PDF from report opens Adobe reader (1 Viewer)

RichO

Registered Yoozer
Local time
Today, 13:36
Joined
Jan 14, 2004
Messages
1,036
Since converting to Access 2010, when I use the "PDF or XPS" button to create a PDF from a report, after the save dialog it opens the PDF in Adobe reader, and then after I close it there is another dialog with the option to save the export steps. Is there any way to just be able to save the PDF and go back to where I was without having to do the extra clicks to get back?

Back in Access 2000 I had created a custom button on a toolbar that would automatically make a PDF from the open report, but that didn't transfer over when I converted the database to 2010.


Thanks
 

Eljefegeneo

Still trying to learn
Local time
Today, 11:36
Joined
Jan 10, 2011
Messages
904
Is this what you are looking for?
.OutputTo(ObjectType, ObjectName, OutputFormat, OutputFile, AutoStart, TemplateFile, Encoding, OutputQuality)

DoCmd.OutputTo acOutputReport, MyRpt, acFormatPDF, MyPath & MyFileName, False

The "False" at the end sets the "AutoStart" to false and thus does not open the report.
 

RichO

Registered Yoozer
Local time
Today, 13:36
Joined
Jan 14, 2004
Messages
1,036
Actually this refers to creating a PDF using the "PDF or XPS" button on the quick access toolbar. I have created another thread asking about creating a custom button on the quick access toolbar.
 
Last edited:

Eljefegeneo

Still trying to learn
Local time
Today, 11:36
Joined
Jan 10, 2011
Messages
904
Why don't you just create a macro and then add that to the QAT?
 

RichO

Registered Yoozer
Local time
Today, 13:36
Joined
Jan 14, 2004
Messages
1,036
Can a button created from a macro be added to the QAT or only the ribbon. I have found ways to add a custom button to the ribbon but not the QAT.
 

Eljefegeneo

Still trying to learn
Local time
Today, 11:36
Joined
Jan 10, 2011
Messages
904
I am using Ac2010, go to the QAT, click on the commands drop down list and you should see macros.
 

RichO

Registered Yoozer
Local time
Today, 13:36
Joined
Jan 14, 2004
Messages
1,036
OK, there are 3 options for macro. There is macro, then macro with an icon next to it, and macro & code. 1 and 3 have a drop down button next to it but it does nothing. I am assuming it's because there are no macros to pick from. Which one do you think I should use? I will toy around with this and see what I can come up with.

Thanks
 

Eljefegeneo

Still trying to learn
Local time
Today, 11:36
Joined
Jan 10, 2011
Messages
904
I am not sure what you are doing, but when I do it, I already have a macro set up. Then I just select that one. Sorry I can't be of more help.
 

RichO

Registered Yoozer
Local time
Today, 13:36
Joined
Jan 14, 2004
Messages
1,036
Got it figured out. I just created a function:

Function MacroPDF()
DoCmd.OutputTo acOutputReport, Application.CurrentObjectName, acFormatPDF, , False
End Function

...which will grab the name of the current report, and convert it to PDF. Then I created a macro that ran this function. Easier than I thought it would be.
 

RichO

Registered Yoozer
Local time
Today, 13:36
Joined
Jan 14, 2004
Messages
1,036
Sometimes smart but very green when it comes to macros because I had never used them before :)
 

Users who are viewing this thread

Top Bottom