Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

View Snapshot Document from Form previously Saved

Status
Not open for further replies.

charcurley

Programmer
Aug 16, 2001
29
0
0
Hello. At the moment I create a snapshot document from a report and save it to a directory with a unique number related to the particular file. Now what I would like to do is place a button on a form and open this .snp file when needed? Any help greatly appreciated!
 
I assume you are talking about Microsoft Access..

Insert SnapshotViewer on your form
INSERT > ACTIVEX > SNAPSHOT VIEWER

to view the file set its path like below.
Code:
Me.SnapshotViewer0.SnapshotPath = "C:\Report1.snp"

________________________________________________________
Zameer Abdulla
Help to find Missing people
You may be the boss' pet; but you are still an animal
 
Thanks. First I need it to check to see if there is a file with that particular number in the directory and if it is I need it to appear. The number will change as the file does. I can do this with an RTF file but wanted to do something similar with a snapshot.
 
check to see if there is a file
Have a look to the Dir function.
I can do this with an RTF file but wanted to do something similar with a snapshot
What's the diff ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Well, you could set the viewer to invisible and check for the file existing using a button click:

Private Sub cmdCheck_Click()
On Error GoTo Err_cmdCheck_Click


Dim myFile

myFile = Dir("C:\Snapshots\YourFile.snp") 'Check to see if file exists

If myFile = "" Then
MsgBox "File Does Not Exist. Please check File and FileName.", vbInformation
Else:
Me.SnpView1.Visible = True
Me.SnpView1.SetFocus

End If

Private Sub SnpView1_Enter()
Me.SnpView1.SnapshotPath = "C:\snapshots\YourFile.snp"
End Sub

Exit_cmdCheck_Click:
Exit Sub

Err_cmdCheck_Click:
MsgBox Err.Description
Resume Exit_cmdCheck_Click

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top