Thank you for taking the time to report an issue.
What's wrong... Please write below.
Is there a way around it? Am I missing something?
The code I use:
DoCmd.OutputTo acOutputReport, "whatever", acFormatSNP, "T:\whatever.snp"
DoCmd.OutputTo acOutputReport, "whatever_1", acFormatSNP, "T:\whatever_1.snp"
The problem is that the second outputto never runs.
It only executes the first one, not the second.
However when I put this code in a button script it does work.
My problem is that I do not want to press a button to achieve this, the reports should automatically be saved as snapshots each time the dbase is run.
Has anyone have the same problem with docmd.outputto.>
I have got close, but the best I can do is to flick up what looks like an empty dialog box, which immediately disappears.
from 2005! is there any way to do this that can be incorporated into VBA?
I have tried to display an error message but Access just freezes and I get the program not responding message |
(I even tried opening the report first and then using the option within "Docmd.OutputTo" to print the active object, but tono avail.)
Attached is an image of two graphics- the left image does not show any dashed effect, while the right one does. The effect is much more pronounced when printed.
DoCmd.OutputTo acOutputReport, "rpt25+Anes", acFormatPDF, "Z:\Erx\Anes25+.pdf", False
DoCmd.OutputTo acOutputReport, "rpt25+Barb", acFormatPDF, "Z:\Erx\Barb25+.pdf", False
DoCmd.OutputTo acOutputReport, "rpt25+CUH", acFormatPDF, "Z:\Erx\CUH25+.pdf", False
The code works fine, the problem is that the second report, "rpt25+Barb" doesn't have any data yet. So I wind up creating a .pdf for my admin to send out that is empty. I create these reports every month.
Down the road that second report will have some data at some point and so I want to have that report ready to go when that does happen.
Now is there a way to check to see if the second report has data and if not, jump to the next OutputTo? If the second report does have data, follow thorough with the OutputTo command.
I have tried playing with HasData property,
The format to which you are attempting to output the current object is not available.
1) DoCmd.OutputTo acOutputReport, strSource, acFormatXLSX, , False
where strSource is the name of the report.
Researching the error seems to indicate that outputting a report to Excel will only work if SP2 is installed, but I do have SP2 installed.
DoCmd.OutputTo acOutputReport, "PDF-DirNames", acFormatPDF, IPPath & "\PDF-DirNames.PDF", True
It might be that the code is compiled into an A2003 mde file but executed in an A2007 environment?