OutputTo Command, include subreports

S

Sean H

Hi,
I'm trying use the OutputTo in VB to have an output file of the report
currently open. The report has 2 subreports that are not being included in
the outfile. Is there a way to include the report with its two subreports in
the outfile or is Access limited in that way. Any suggestions or help would
be greatly appreciated! Here's the piece of code I'm working with:

Dim dr_num
Dim dr_file

dr_num = Forms!DUALFORM!DR
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "DRPRINT2", acViewPreview
DoCmd.OutputTo acOutputReport, "DRPRINT2", acFormatTXT,
"C:\Documents and Settings\se20781\Desktop\" & dr_num & ".txt"
DoCmd.Close acReport, "DRPRINT2"
DoCmd.Close acForm, "DUALFORM"

(note: I'd love to have a .pdf file output but I don't know how involved
that would be)

Thanks,
 
K

krissco

Hi,
I'm trying use the OutputTo in VB to have an output file of the report
currently open. The report has 2 subreports that are not being included in
the outfile. Is there a way to include the report with its two subreports in
the outfile or is Access limited in that way. Any suggestions or help would
be greatly appreciated! Here's the piece of code I'm working with:

Dim dr_num
Dim dr_file

dr_num = Forms!DUALFORM!DR
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "DRPRINT2", acViewPreview
DoCmd.OutputTo acOutputReport, "DRPRINT2", acFormatTXT,
"C:\Documents and Settings\se20781\Desktop\" & dr_num & ".txt"
DoCmd.Close acReport, "DRPRINT2"
DoCmd.Close acForm, "DUALFORM"

(note: I'd love to have a .pdf file output but I don't know how involved
that would be)

Thanks,

I don't know about the subreports & text format - I can tell you that
outputting to PDF is not difficult. If you can output to snapshot, you
can output to PDF. I'm assuming that you are NOT running A2007. I
recommend checking out Lebans' code: http://www.lebans.com/reporttopdf.htm

-Kris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top