Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving a report to a file using code in a report module 1

Status
Not open for further replies.

vbajock

Programmer
Jun 8, 2001
1,921
US
I have an application that saves report output to a file so that the file can later be attached to automated emails. In the past, I have used the "OutputTo" command to export the report as a snapshot, works great most of the time. The problem that has arised is that one particular report needs to load a control table in order to turn subreports off and on, but it seems that if you use the "OutputTo" command to print the report, it doesn't cause the code in the code module to execute. I am thinking the solution is to output the report to a file as part of the report.close event. How does one do this? And is there anyway to get OutputTo to execute the code?
 
vbajock said:
...if you use the "OutputTo" command to print the report, it doesn't cause the code in the code module to execute.

What event in the report are you using? I created a report with [tt]MsgBox "Hello world!"[/tt] in the Open event and I get the message box when using OutputTo (XP SP2, A2K SP1).

Are you by chance trying to use an event that only fires when the report is displayed on the screen, for example the Activate event?

CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top