Topics Search


Views: 73
Can you specify a sheet name in the DoCmd.OutputTo command when trying to export multiple reports to multiple sheets in the same excel file? If yes, what is the syntax?
Sponsored Links:

Similar posts...


DoCmd.OutputTo AcFormatPDF

DoCmd.OutputTo AcFormatPDF Icon
I'm trying to use DoCmd.OutputTo to save a report as a PDF file. The trouble I'm having is that it seems to ignore the formatting set in VBA. In this case if a certain condition is true thePageHeader is hidden, the problem is that DoCmd.OutputTo prints that header even if the condition is true.

Is there a way around it? Am I missing something?

Filter a report in DoCmd.OutputTo

Filter a report in DoCmd.OutputTo Icon
How do you filter a report you use in

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 not working

Docmd.Outputto not working Icon
I am trying to create a image from an Access report. This report has a chart on it. My Docmd.Outputto code doesn't seem to work right. I've tried

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.

outputto challenge

outputto challenge Icon
In VBA I'm trying to export 2 reports of my dbase as snapshots to a folder where users have access to.

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.&gt

docmd.outputto messages

docmd.outputto messages Icon
Has anyone had any success suppressing the "now outputting" dialog boxes you get 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?

docmd.transferspreadsheet crashes access

docmd.transferspreadsheet crashes access Icon
I am having some trouble with the docmd.transferspreadsheet function, everytime I run it, it crashes Access. I have used the docmd.outputto function and that works fine but I need the queries to be in the same excel file but in different sheet and the docmd.outputto open a new excel file for each query.


I have tried to display an error message but Access just freezes and I get the program not responding message |

DoCmd.OutputTo, 2007 - 2000

DoCmd.OutputTo, 2007 - 2000 Icon
I have some code, working in Access 2007.
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

Creating PDFs with Docmd.OutputTo

Creating PDFs with Docmd.OutputTo Icon
When printing reports directly to PDFs using "Docmd.OutputTo" some lines (inside graphics) appear dashed. When the report is opened and printed to Adobe PDF or when the report is queued directly to a printer, the lines are not dashed.

(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.OpenReport with a Filter??

DoCmd.OpenReport with a Filter?? Icon
From eRed the Noobe :-)

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

Supressing .pdf creation in acOutputTo

Supressing .pdf creation in acOutputTo Icon
I am using VBA in Access 2007 and have the following code on a button in a stand alone form (form isn't tied to any data);

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,