Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Enum opgRptType
XLS = 1
RTF = 2
SNAPSHOT = 3
HTML = 4
End Enum
Public Function ExportReportToFile(strReportName As String, Optional lngRptType As opgRptType, Optional bolOpen As Boolean = False) As Boolean
Dim strReportPath As String
strReportPath = App.Path & "\"
If Not (appAccess Is Nothing) Then
If AccessObjectExists("Report", strReportName) Then
With appAccess
' Output or display in specified format.
Select Case lngRptType
Case XLS
.DoCmd.OutputTo acOutputReport, strReportName, acFormatXLS, _
strReportPath & strReportName & ".xls", bolOpen
Case RTF
.DoCmd.OutputTo acOutputReport, strReportName, acFormatRTF, _
strReportPath & strReportName & ".rtf", bolOpen
Case SNAPSHOT
' Snapshot Viewer must be installed to view snapshot
' output.
.DoCmd.OutputTo acOutputReport, strReportName, acFormatSNP, _
strReportPath & strReportName & ".snp", bolOpen
Case HTML
.DoCmd.OutputTo acOutputReport, strReportName, acFormatHTML, _
strReportPath & strReportName & ".htm", bolOpen
Case Else
.Visible = True
.DoCmd.OpenReport strReportName, acViewPreview
End Select
End With
ExportReportToFile = True
Else
MsgBox strReportName & " could not be found. Please check your database for the report.", vbExclamation & vbOKOnly, "ExportReportToSnap Failure"
ExportReportToFile = False
End If
Else
ExportReportToFile = False
End If
End Function