OutputTo Command, include subreports

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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,
 
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
 
Back
Top