Microsoft Office 2000/Visual Basic Programmer's Guide |
You can save Access reports as HTML files (.htm). However, an Access report saved as HTML doesn’t retain all of its formatting. If you want to view a formatted Access report in a Web page, save it as a report snapshot file (.snp), and then use the Snapshot Viewer ActiveX control (Snapview.ocx) to embed the report snapshot in a Web page. You can also view a report snapshot file in the Snapshot Viewer, which is included with Microsoft Access, and which can be downloaded free of charge from the Microsoft Office Developer Forum Web site at http://msdn.microsoft.com/officedev/index/snapshot.htm. Users who don’t have Access can use the Snapshot Viewer to view Access reports.
A report snapshot displays only static data. To update the data in a report snapshot, you must re-create the report snapshot file from the report.
To create a report snapshot from VBA, use the OutputTo method of the Access DoCmd object, passing in the constant acFormatSNP for the outputformat argument. For example, the following line of code creates a report snapshot file from an Access report named Invoice:
DoCmd.OutputTo acOutputReport, "Invoice", acFormatSNP, _
CurrentProject.Path & "\Invoice.snp"
Note You can also use the OutputTo method to output data from Access to a number of other formats, which may be useful for creating custom reports. For more information, search the Microsoft Access Visual Basic Reference Help index for "OutputTo method."
For more information about creating report snapshot files, search the Microsoft Access Help index for "report snapshots."