Q: Run-time error '2501' This thread is locked from future replies


I have a command button in Access 2007 that is supposed to save a report called "CycleReportFresh" as a pdf file in a specified directory under a specified name. It gives me the following error message:

Run-time error '2501': The OutputTo file action was canceled.

What is wrong with this code?


Private Sub Command193_Click()

DoCmd.OutputTo acOutputReport, "CycleReportFresh", acFormatPDF, "C:\My Documents\Work\P-Data\D-B\rptFoo.pdf"


End Sub


Thank you



DId you create that directory?  Because there is no *C:\My Documents\...* on Windows 7 machines, it would C:\Users\YourComputersName\Documents\*
Gina Whipp
Microsoft MVP (Access 2010-2015)

Did this solve your problem?

Sorry this didn't help.

Question Info

Views: 4,559 Last updated: February 20, 2018 Applies to: