ACC97: How to Use Visual Basic for Applications to Export a Report in Snapshot Format
This article was previously published under Q307184
This article has been archived. It is offered "as is" and will no longer be updated.
Moderate: Requires basic macro, coding, and interoperability skills.
This article shows you how to use Visual Basic for Applications (VBA) code to export a Microsoft Access report in Snapshot format.
With Microsoft Access 97 Service Release 1 and Microsoft Office 97 Service Release 1, you can save a static picture of a Microsoft Access report in an external file format (*.snp). You can then make the report available to users who do not have Microsoft Access installed on their computers. For example, you can send the report in e-mail or copy it to a user's hard disk. The user has to have only Microsoft Snapshot Viewer to view the report.
If you have Microsoft Access 97 Service Release 1 or Microsoft Office 97 Service Release 1 on compact disc (CD), you can find Snapshot Viewer at the following location on the CD:
ValuPack\AccessSnpvw80.exe is a self-extracting file that installs Snapshot Viewer. Double-click the Valupk8.hlp file on your CD (located in the ValuPack folder) for information about how to install ValuPack features, including Snapshot Viewer.
For an example of how to use Visual Basic for Applications to export a Microsoft Access report in Snapshot format, follow these steps:
CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.
- Open the sample database Northwind.mdb.
- Create a new form in Design view.
- Make sure that the Control Wizards button in the toolbox is not turned on.
- Add a command button to the form.
- Right-click the command button, and then click Properties.
- Click the All tab.
- Change the Caption property to Export Report as SNP.
- Close the property sheet.
- Right-click the command button, and then click Build Event.
- In the Choose Builder dialog box, click Code Builder, and then click OK.
- Type or paste the following code:
On Error Resume Next Dim stDocName As String stDocName = "Sales by Category" DoCmd.OutputTo acReport, stDocName, "SnapshotFormat(*.snp)", ""
- On the File menu, click Close and Return to Microsoft Access to return to the form.
- View the form in Form view.
- Click the command button.
- In the Output To window, select the folder to which you want to save the report.
inf Snapshot Format Export Report
Article ID: 307184 - Last Review: 12/06/2015 05:18:45 - Revision: 3.1
Microsoft Access 97 Standard Edition
- kbnosurvey kbarchive kbhowto KB307184