Topics Search

DoCmd.OutputTo

DoCmd.OutputTo
Views: 72
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:

More topics

 

DoCmd.OutputTo AcFormatPDF

Preview
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

Preview
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

Preview
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

Preview
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

Preview
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

Preview
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.

[CODE]

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

DoCmd.OutputTo, 2007 - 2000

Preview
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

Preview
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.OutputTo

Preview
I use DoCmd.OpenReport and the Load event code gets executed. But if I use DoCmd.OutputTo, the Load event does not fire. I want that Load code to fire when I output the report without opening it.
 

Supressing .pdf creation in acOutputTo

Preview
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,