B
Bill Johnson
I'm using Access 2007 with Windows XP. I'm sending two reports in Snapshot
Format to a folder. For some strange reason one of the reports kicks me out
of the VB code without even producing an error. I switched the order of the
two reports and I still get kicked out by the same report. The code produces
both the files when I put the problem report second and only the first report
when I put that command first.
Private Sub Export_Report_Click()
On Error GoTo Err_Export_Report_Click
Dim stRpt1 As String
Dim stRpt2 As String
Dim stPath1 As String
Dim stFile1 As String
Dim stFile2 As String
stRpt1 = "rptSummarySheet"
stRpt2 = "rptGLAnalysis"
stPath1 = "C:\ACL Data\NRCS\SourceFiles\"
stFile1 = stPath1 & "GLSummarySheet1.snp"
stFile2 = stPath1 & "GLAnalysis.snp"
DoCmd.OutputTo acOutputReport, stRpt2, acFormatSNP, stFile2
MsgBox "Your Report has been saved to: " & stPath1 & stFile2
DoCmd.OutputTo acOutputReport, stRpt1, acFormatSNP, stFile1
******************************************************
********** NOTHING PAST THIS POINT RUNS ******************
******************************************************
MsgBox "Your Report has been saved to: " & stPath1 & stFile1
Exit_Export_Report_Click:
Exit Sub
Err_Export_Report_Click:
MsgBox "You have encountered an error. " & Chr(10) & Chr(13) & _
"Error Number: " & Err.Number & Chr(10) & Chr(13) & _
"Error Description: " & Err.DESCRIPTION
End Sub
I get what I need out of this routine, but this is puzzling.
Any help?
Format to a folder. For some strange reason one of the reports kicks me out
of the VB code without even producing an error. I switched the order of the
two reports and I still get kicked out by the same report. The code produces
both the files when I put the problem report second and only the first report
when I put that command first.
Private Sub Export_Report_Click()
On Error GoTo Err_Export_Report_Click
Dim stRpt1 As String
Dim stRpt2 As String
Dim stPath1 As String
Dim stFile1 As String
Dim stFile2 As String
stRpt1 = "rptSummarySheet"
stRpt2 = "rptGLAnalysis"
stPath1 = "C:\ACL Data\NRCS\SourceFiles\"
stFile1 = stPath1 & "GLSummarySheet1.snp"
stFile2 = stPath1 & "GLAnalysis.snp"
DoCmd.OutputTo acOutputReport, stRpt2, acFormatSNP, stFile2
MsgBox "Your Report has been saved to: " & stPath1 & stFile2
DoCmd.OutputTo acOutputReport, stRpt1, acFormatSNP, stFile1
******************************************************
********** NOTHING PAST THIS POINT RUNS ******************
******************************************************
MsgBox "Your Report has been saved to: " & stPath1 & stFile1
Exit_Export_Report_Click:
Exit Sub
Err_Export_Report_Click:
MsgBox "You have encountered an error. " & Chr(10) & Chr(13) & _
"Error Number: " & Err.Number & Chr(10) & Chr(13) & _
"Error Description: " & Err.DESCRIPTION
End Sub
I get what I need out of this routine, but this is puzzling.
Any help?