Link to home
Create AccountLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

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

strClientAppealsAttachmentFolderDataPath

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.

????
Avatar of bfuchs
bfuchs
Flag of United States of America image

Make sure you have full rights to copy things into that folder.
try first using FileCopy method to that location, see what happens.
Avatar of SteveL13

ASKER

I do have full rights.  And please remember, I don't want to preview the report.  Just copy it to the directory.
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Got it.  I had to change this:

strClientAppealsAttachmentFolderDataPath

to this:

strClientAppealsAttachmentFolderDataPath & "\rptReportName.PDF"