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:
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: