Private Sub OutputReports()
Dim sSendObjectOutputFileType As String
Dim sOutputToFileType As String
Dim sOutputToFileTypeExtension As String
Dim sVersionOfAccess As String
If (SysCmd(SYSCMD_ACCESSVER)) = "12.0" Then
sVersionOfAccess = "Access2007"
[COLOR="Red"] sSendObjectOutputFileType = "PDF Format (*.pdf)"
sOutputToFileType = acFormatPDF
sOutputToFileTypeExtension = ".pdf"[/COLOR]
Else
sVersionOfAccess = "Access2003"
sSendObjectOutputFileType = "SnapshotFormat(*.snp)"
sOutputToFileType = acFormatSNP
sOutputToFileTypeExtension = ".snp"
End If
Dim sOutputPath As String
Dim sOutputFileName As String
sOutputPath = CurrentProject.Path & "\"
sOutputFileName = SnapReportName
StrDefaultPathAndFileName = sOutputPath & SnapReportName & sOutputToFileTypeExtension
If Dir(StrDefaultPathAndFileName) <> "" Then
Kill StrDefaultPathAndFileName
DoEvents
End If
DoCmd.OutputTo acOutputReport, SnapReportName, sOutputToFileType, sOutputPath & sOutputFileName & sOutputToFileTypeExtension, True
End Sub