Re:coding to export to Excel

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



To export multiple reports ,just add an additional line in your sub
referencing the name of the next report

Private Sub Report_1_Click()
DoCmd.OutputTo acOutputReport, "Report1", acFormatXLS, , -1
DoCmd.OutputTo acOutputReport, "Report2", acFormatXLS, , -1

End Sub


"Lauren B" wrote:

> I have figured out how to automate the exportation of a file; however, is it
> possibe to get two different reports to open the same Excel document?
>
> My current code for one report is as follows:
> Private Sub Report_1_Click()
> DoCmd.OutputTo acOutputReport, "Report1", acFormatXLS, , -1
> End Sub
>
> How can I add Report 2 to this code?
>
> Thank you very much for any assistance.
>
> LB
>
>
>
.



Relevant Pages

  • Re: Option Button
    ... ' This procedure used in Preview_Click and Print_Click Sub procedures. ... ' Preview or print report selected in the ReportToPrint option group. ... DoCmd.OpenReport "Quarter-wise Report", PrintMode ... Private Sub Preview_Click ...
    (microsoft.public.access.formscoding)
  • Re: Report prints data twice on two different pages
    ... SQL record source from Part Certification Report: ... Record Source from Cert Order Sub: ... "Duane Hookom" wrote: ... Part Certification with the key field of PartCertificationID with a one to ...
    (microsoft.public.access.reports)
  • Dynamic Crosstab...SOS
    ... I'm trying to produce a report based on a dynamic crosstab. ... Dim rstReport As DAO.Recordset ... Private Sub InitVars() ... Dim intX As Integer ...
    (comp.databases.ms-access)
  • [PATCH] update checkpatch.pl to version 0.16
    ... This version brings proper quote tracking across lines, ... report on direct use of NR_CPUS ... check spacing round -> correctly across newlines ... +sub sanitise_line_reset { ...
    (Linux-Kernel)
  • Re: Report prints data twice on two different pages
    ... I have the sub reports made and have them in the main report now but the ... "Duane Hookom" wrote: ... Part Certification with the key field of PartCertificationID with a one to ...
    (microsoft.public.access.reports)