And 2501 is?![]()
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
In the line above the yellow line add:
Debug.Print Dateiname
to verify that the filename is being properly created.
The result will show in the immediate window.
Try opening the report first (hidden if you prefer) then output.
And yes, always post the error message. No way to remember all of the thousands of messages that go with numbers, and the onus is on the original poster to provide that info.
My suggestion is a guess, based on (I think) seeing this problem elsewhere in the last few days. As to why things stop working, it's usually because of updates.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
Sorry, I forgot to write the error text that goes with it.
It says: The OutputTo action was cancelled.
I tried to implement the suggestions for improvement but it didn't work until now. Does anyone have any ideas?
pretty sure "PDF" is not valid, think it should be acFormatPDF (no quotes)
I would have thought so as well, however
I have Google on this laptop and it gives me https://www.google.com/search?q=docm...hrome&ie=UTF-8
From that I can get https://codekabinett.com/rdumps.php?...docmd-outputto
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
I would have thought so as well, however
I have Google on this laptop and it gives me https://www.google.com/search?q=docm...hrome&ie=UTF-8
From that I can get https://codekabinett.com/rdumps.php?...docmd-outputtoI have updated my code like this, but the error code still comes up.Code:Dim reportName As String Dim Dateiname As String reportName = "repOfferte" Dateiname = Forms!foOfferteInhalt!AngebotNr & " Offerte " & Forms!foOfferteKundenDaten!NameKunde & " .pdf" DoCmd.OpenReport reportName, acViewPreview DoCmd.OutputTo acOutputReport, reportName, acFormatPDF, Dateiname DoCmd.Close acReport, "repOfferte"
if you debug.print Dateiname
what do you get?
it may not like the space before .pdf
And perhaps it is in your variables but do you have a proper path? i.e. c:\somefolder\....
Didn't work aswell, the error occures in this line:
Code:DoCmd.OutputTo acOutputReport, reportName, acFormatPDF, Dateiname
The suggestion in Post#3 (and Post#10) was not to correct the error, but to diagnose the problem. What did the Debug.Print show?
Saying 'Did not work' and simply repeating the original problem is quite unhelpful.
Okey sorry, the same error occured. It says: The OutputTo action was cancelled.
Please show your current code within code tags.
Also show the output of the Debug..Print Dateiname
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
That is not what is displayed via a Debug.Print.Okey sorry, the same error occured. It says: The OutputTo action was cancelled.
If you don't know how to properly use the Immediate Window, change the Debug.Print line before the yellow line to display a message box:
Msgbox "Dateiname is " & Dateiname
What does the message box show?