K
Kevin Dunn
Hi,
I am looking for a way to open saved Snapshot Reports from Access. I want
to allow users to select a saved report (e.g., TestReport.snp) from within
Access using the File Dialog box and then have that report open up in a
separate window.
I tried adding the Snapshot Viewer control to a form and opening the reports
that way, but it doesn't give users the same flexibility as when they open
the report by double clicking on it. How can I achieve this same effect in
Access without necessarily using the Snapshot Viewer object? I also tried
using the Shell function but with no success because I didn't know how to
pass the report name to the Snapshot Viewer once it was opened. I'm using
Access 2002 in Windows XP. Any help on this would be greatly appreciated.
Thanks.
Kevin
'CODE SAMPLES
retVal = Shell("C:\Program Files\Common Files\Microsoft Shared\Snapshot
Viewer\SnapView.exe", 1)
----------------------------------------------------------------------------------------------------------
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
'Set default file folder
dlgOpen.InitialFileName = "W:\Saved Reports"
'Display FileDialog box
''dlgOpen.Show
'Perform if user selected a report
If dlgOpen.Show = -1 Then
For Each varItem In dlgOpen.SelectedItems
'User selected the report "TestReport.snp"
strFileName = varItem
Next varItem
'Show selected report
DoCmd.openForm "frmSnapshotReport_new"
Forms!frmSnapshotReport_new!snpViewer.SnapshotPath = strFileName
Forms!frmSnapshotReport_new.Caption = Mid(strFileName, 18)
End If
----------------------------------------------------------------------------------------------------------
I am looking for a way to open saved Snapshot Reports from Access. I want
to allow users to select a saved report (e.g., TestReport.snp) from within
Access using the File Dialog box and then have that report open up in a
separate window.
I tried adding the Snapshot Viewer control to a form and opening the reports
that way, but it doesn't give users the same flexibility as when they open
the report by double clicking on it. How can I achieve this same effect in
Access without necessarily using the Snapshot Viewer object? I also tried
using the Shell function but with no success because I didn't know how to
pass the report name to the Snapshot Viewer once it was opened. I'm using
Access 2002 in Windows XP. Any help on this would be greatly appreciated.
Thanks.
Kevin
'CODE SAMPLES
retVal = Shell("C:\Program Files\Common Files\Microsoft Shared\Snapshot
Viewer\SnapView.exe", 1)
----------------------------------------------------------------------------------------------------------
Set dlgOpen = Application.FileDialog(msoFileDialogOpen)
'Set default file folder
dlgOpen.InitialFileName = "W:\Saved Reports"
'Display FileDialog box
''dlgOpen.Show
'Perform if user selected a report
If dlgOpen.Show = -1 Then
For Each varItem In dlgOpen.SelectedItems
'User selected the report "TestReport.snp"
strFileName = varItem
Next varItem
'Show selected report
DoCmd.openForm "frmSnapshotReport_new"
Forms!frmSnapshotReport_new!snpViewer.SnapshotPath = strFileName
Forms!frmSnapshotReport_new.Caption = Mid(strFileName, 18)
End If
----------------------------------------------------------------------------------------------------------