Output to Action Cancelled problem (1 Viewer)

123dstreet

Registered User.
Local time
Yesterday, 19:53
Joined
Apr 14, 2010
Messages
122
Hi all!

I've been running a code that has been working perfectly for the last 6 months, but today, i'm receiving an error that is cancelling the code. The error code that pops up is "Output to action cancelled"

It basically compares 2 tables in a query, then creates a report to note the differences in the query, and then saves the report as a pdf to the network drive. For some reason its only the one computer that this error is occuring on, and it WAS working fine until today. There was just an ADOBE update done, could this be part of the problem? Any idea's would be greatly appreciated!

Here is the code:


Code:
Private Sub Form_Close()
On Error GoTo Err_Form_Close
Dim ReportFolder As String
Dim ReportFile As String
Dim stDocName As String
Dim stReport As String
Dim LUser As String
Refresh
 
ReportFolder = DLookup("[WO Report Folder]", "Setup", "[ID]=4")
stReport = "Inventory Change Report"
stDocName = "Complete parts list Without Matching TempParts"
 
LUser = CurrentUser()
If Right(ReportFolder, 1) = "\" Then GoTo Report2 Else GoTo Report1
Report1:
ReportFile = ReportFolder & "\" & "Inventory Change" & " " & "by" & " " & LUser & " " & "on" & " " & Format(Date, "mmm dd, yyyy") & " " & "at " & Format(Now, "hnn AMPM") & " " & ".pdf "
GoTo Continue1
Report2:
ReportFile = ReportFolder & "Inventory Change" & " " & "by" & " " & LUser & " " & "on" & " " & Format(Date, "mmm dd, yyyy") & " " & "at " & Format(Now, "hnn AMPM") & " " & ".pdf "
GoTo Continue1
Continue1:
DoCmd.OpenQuery stDocName, acViewNormal
If DCount("*", "Complete parts list Without Matching TempParts") = 0 Then GoTo NoData
 
DoCmd.OpenReport "Inventory Report", acViewPreview
DoCmd.OpenReport stReport, acViewPreview
 
DoCmd.Close acQuery, stDocName
DoCmd.OutputTo acOutputReport, "Inventory Change Report", acFormatPDF, ReportFile
DoCmd.Close acReport, "Inventory Report"
DoCmd.Close acReport, stReport
NoData:
DoCmd.Close acQuery, stDocName
Exit Sub
Exit_Form_Close:
    Exit Sub
Err_Form_Close:
    MsgBox Err.Description
    Resume Exit_Form_Close
 
 
End Sub
 
Last edited:

123dstreet

Registered User.
Local time
Yesterday, 19:53
Joined
Apr 14, 2010
Messages
122
Thanks for your prompt reply, I tried those suggested fixes in the link you sent, but i'm still getting the same error. I just realized that this error is also now happening on my Windows 7 machine, it worked fine on June 1st, but now on both computers it's giving me the "output to action cancelled" error. I'm confused.
 

AccessMSSQL

Seasoned Programmer-ette
Local time
Yesterday, 19:53
Joined
May 3, 2012
Messages
636
Just a long shot but what is the path to your ReportFolder - did that somehow change or is no longer available?

I would create a test module on the machines that have the problem. Just output a simple report to a local folder and see if it produces same error?


http://www.accessmssql.com/
 

AccessMSSQL

Seasoned Programmer-ette
Local time
Yesterday, 19:53
Joined
May 3, 2012
Messages
636
Another thing to check - perhaps the query output is not producing any result set?
 

123dstreet

Registered User.
Local time
Yesterday, 19:53
Joined
Apr 14, 2010
Messages
122
i will give that a try. On another machine, i don't have any problems saving the report to the same network folder, so i'm not sure this will help, but i will try anyway.
 

123dstreet

Registered User.
Local time
Yesterday, 19:53
Joined
Apr 14, 2010
Messages
122
I have a line in the code to cancel / close the report if there is no data results in the query, but I do believe i solved the problem... I went into the setup table: ReportFolder = DLookup("[WO Report Folder]", "Setup", "[ID]=4"), and deleted then re wrote the destination folder for these reports, and now it works fine again although i'm still confused as to why it works because nothing was ever changed in that table, or on the network. But it does work again, thanks for your help! Much appreciated!
 

Users who are viewing this thread

Top Bottom