Can't output report as pdf in Access 2010 (1 Viewer)

Jefree

New member
Local time
Today, 03:55
Joined
Nov 17, 2011
Messages
6
I receive The OutputTo Action Was Cancelled, Error 2501 when trying to output a report as a pdf with Access 2010 and Adobe Acrobat X.

DoCmd.OutputTo acOutputReport, "Data", acFormatPDF, "FullPathToFile.pdf", True

Can anyone tell me what might be causing this. The report has data and I can preview it and even export to pdf by using the acrobat tab in the ribbon. Thanks!
 

vbaInet

AWF VIP
Local time
Today, 11:55
Joined
Jan 22, 2010
Messages
26,374
In what event did you put this code? And where are you calling the code from?

By the way, Data is not a good name for a report. It's an Access/VBA reserved keyword.
 

FHLTICIA

New member
Local time
Today, 11:55
Joined
Nov 17, 2006
Messages
5
I am also having this problem, but only on one PC. If I output the PDF to the network drive it works OK. Output of excel files to the same folder works fine

The code works on every other PC it has ever been run on. The system failing is running WIN7 Office 2010 as is the development system which I work on

Function mdlPDFreportCreate(BillingReport As String, BillReportName As String, ReportFullLocation As String)
'create a pdf file based on the report name passed to the function
'Optional parameter allows bypass of msgbox confirming output

ReportFullname = ReportFullLocation & BillingReport & ".pdf"

DoCmd.OutputTo acReport, BillReportName, acFormatPDF, ReportFullname

End Function
 

vbaInet

AWF VIP
Local time
Today, 11:55
Joined
Jan 22, 2010
Messages
26,374
Are you having the same error message? Does the user have Write permissions to create a file on that directory and write to it?
 

joeKra

Registered User.
Local time
Today, 06:55
Joined
Jan 24, 2012
Messages
208
i had the same problem, i found the problem was that the file name had include characters which is not aloud to use in a file Name, i.e. (\!/),
hope it helps

UPDATE:
i see that you didn't add a forward slash after the path, this would cause an error if you try to save it in a parent folder you don't have permission,
 

vbaInet

AWF VIP
Local time
Today, 11:55
Joined
Jan 22, 2010
Messages
26,374
UPDATE:
i see that you didn't add a forward slash after the path, this would cause an error if you try to save it in a parent folder you don't have permission,
Good thinking and you may be right but this is only speculation. We don't know what the string variable ReportFullLocation contains.
 

daveyj85

New member
Local time
Today, 11:55
Joined
Dec 29, 2006
Messages
1
I have the same problem, all the "My Documents" folders are on a server for all pc's, Access 2007 on xp seems to be able to store in those locations, 2010 on win 7 will not.
My users don't log into their front ends so I think I need to find the full network address for the user logged onto the pc.
sample address:-\\Mars\Profiles\djones\My Documents\Purchase Orders.
It's beyond me, although I may even be barking up the wrong tree.
 

Users who are viewing this thread

Top Bottom