Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / October 2006

Tip: Looking for answers? Try searching our database.

Opening a saved Snapshot Report from Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin Dunn - 02 Oct 2006 20:06 GMT
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
----------------------------------------------------------------------------------------------------------
Carl Rapson - 02 Oct 2006 20:28 GMT
> Hi,
>
[quoted text clipped - 40 lines]
> End If
> ----------------------------------------------------------------------------------------------------------

You might be able to use Application.FollowHyperlink instead of Shell,
passing it the name of the Snapshot file to be opened. FollowHyperlink uses
the appropriate default application to open any file (Word for a .doc file,
for example, or Excel for a .xls file). It should work with Snapshot files
as well.

Carl Rapson
Kevin Dunn - 02 Oct 2006 20:58 GMT
Thanks Carl, that's exactly what I needed.  The Application.FollowHyperlink
works like a charm.

Kevin

>> Hi,
>>
[quoted text clipped - 48 lines]
>
> Carl Rapson
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.