Trying to send a report in PDF format to an established folder on computer

I am trying to send a report in PDF format to an established folder on computer.  The folder path is


which I know is a real path because I debug.print it.

I really don't want to preview the report, just send it to the folder.

Here is my code:

DoCmd.OpenReport "rptBillOfLading", acViewPreview, , , acHidden
DoCmd.OutputTo acOutputReport, "rptBillOfLading", acFormatPDF, strClientAppealsAttachmentFolderDataPath

Open in new window

but I get an The OutputTo action was cancelled and the report preview but I don't want it to.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Make sure you have full rights to copy things into that folder.
try first using FileCopy method to that location, see what happens.
SteveL13Author Commented:
I do have full rights.  And please remember, I don't want to preview the report.  Just copy it to the directory.
Dale FyeOwner, Dev-Soln LLCCommented:
if you don't want to preview the report, why area you opening it?

I would agree with bfuchs, that the likely problem would be that you cannot write into the folder you are attempting to.  But additionally the name of that variable is:


which implies a path (not a file name), so you might need to append a file name to that path.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I do have full rights.
Some times you may have rights to do it manually but when comes to do it within code it may not work.
Please try FileCopy first just to determine if thats not the issue, like folliowing
FileCopy("C:\text.txt", "C:\text2.txt") 

Open in new window

SteveL13Author Commented:
Got it.  I had to change this:


to this:

strClientAppealsAttachmentFolderDataPath & "\rptReportName.PDF"
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.