Jim,
I expect the issue might be no records in rpt_33NewHires that match the where condition. Then your report probably has an issue or closes on no records and causes the error in the calling form.
I would check to see if the report's record source combined with the where condition would return any records prior to attempting to open it.
Duane Hookom MVP
MS Access
----------------------------------------
> From: luvmymelody@yahoo.com
>
> I have this function that outputs a report as pdf to a folder location on the network and the process stops on the the outputto line of code. I get a run time error of 2501. The OutputTo action was canceled. When I hover over the docmd.outputto in the highlighted line I see acOutput=3 which I am not sure what that is. Below is part of the code and the last line is what is highlighted. I have a feeling that it is the select statement that is causing the issue. Is there a line in the select statement that I am missing?
>
> Thank You
>
> Jim Wagner
>
> DoCmd.OpenReport "rpt_33NewHires", acViewPreview, _
> WhereCondition:="[Dept Id] IN (SELECT Department " & _
> "FROM [tblPollyDepartments])"
> DoCmd.OutputTo acOutputReport, "rpt_33NewHires", "PDFFormat(*.pdf)", "\\Afwfs\AF\Services\UnivSrv\Admin Services\DATA MANAGEMENT SERVICES\Master PeopleSoft Tables\Repurpose Database\Department Reports\rpt_33FACMANNewHires.pdf", False, "", , acExportQualityPrint
>
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar