DCrake
Remembered
- Local time
- Today, 23:23
- Joined
- Jun 8, 2005
- Messages
- 8,626
Situation is I am trying to create a demo that will be run under either 2003 or 2007 I have saved it as an MDE. When I pick a report to be output to pdf see below
When run as a mdb it works
When run as a mde it fails
Get the error
2282 the format in which you are attempting to output the current object is not available.
Any ideas
Code:
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"
sSendObjectOutputFileType = "PDF Format (*.pdf)"
sOutputToFileType = [B]acFormatPDF[/B]
sOutputToFileTypeExtension = ".pdf"
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
When run as a mdb it works
When run as a mde it fails
Get the error
2282 the format in which you are attempting to output the current object is not available.
Any ideas