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?
DoCmd.OutputTo acOutputReport, "reportName", .
I can filter a report in DoCmd.OpenReport
DoCmd.OpenReport "reportName", acViewNormal, , "[fieldname]=" & "whatever"
The DoCmd.OutputTo doc says that if you leave the Objectname parameter blank it will use the active object. Is there a way to make the report I want to use the active object, filter it then call DoCmd.OutputTo ?
DoCmd.OutputTo acOutputReport, "rptNode", acFormatRTF, "C:\My Documents\rptNode.rtf"
DoCmd.OutputTo acOutputReport, "rptNode", acFormatHTML, "C:\My Documents\rptNode.htm"
and the results are empty. Can you see anything obviously wrong with my code? I am a newbie with Docmd.Outputto.
I have attached mock-up database with this problem in it. The 2 statements above are included preceded by Stop's. Click on the button. These statements are supposed to create an image with rptNode on it. (I only need one.) Do they work for you? You may need to change the file path.
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 want it to work in Access 2000 also.
The export from a table works fine:
DoCmd.OutputTo acOutputTable, "Data", acFormatXLS, , -1
The export from a query does work in Access 2007 but not in Access 2000:
DoCmd.OutputTo acOutputQuery, "Temp_N_Code", acFormatXLS
(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.
I have a report that I am trying to save as a PDF using DoCmd.OutputTo
This code properly saves the report:
DoCmd.OutputTo acOutputReport, "LTCFarNF", acFormatPDF, "M:\ARMGR\Reports\" & Me.ltcfname.Value & Chr(34) & ".pdf", True
However, I need to filter the report. The code below properly lets me preview the report:
DoCmd.OpenReport "LTCFarNF", acViewPreview, , "[LTCFarNF].[ltcfname]=" & Chr(34) & Me.ltcfname.Value & Chr(34)
How can I apply the filter/where to the DoCmd.OutputTo
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,