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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a snapshot of a report

Status
Not open for further replies.

Crowley16

Technical User
Jan 21, 2004
6,931
GB
Hi there, a simple problem, I hope...

I want to create a snapshot of a report
and then open the print menu (the one that lets you select which printer)
then print that snapshot when you click on print

but I don't want to have to save the snapshot, and this should all go in a command button...

Thanks
 
So you really don't need to "do anything" with snapshot, you just want to open the print dialog box for a certain report, then print then be able to print the report where ever you want?

If so you could try something like this...
Code:
'Opens the report in question
DoCmd.OpenReport "customers", acViewPreview

'Prints the report using the print command (control key + p) to Access
SendKeys "^p"

Just a thought...




ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
the trouble I'm having is that there are charts on this report, and whenever I try to print this directly, the charts don't get printed...

so I normally have to make a snp and then print the snp to get the correct print image...

that's why I bring up the whole issue of the snapshot...

I was wondering if it was possible to create like an object, and then bound the snapshot to that object, and the print it, and close it...
I don't want to have to create a file, and print a file, and then delete the file again...

Thanks
 
Hmmmmmm

I don't think you are going to be able to do what you are talking about. The snapshot is a filetype that is actually separate from access. A report does not actually become a snap shot UNTIL you create a file.

What if we focused more on why your charts are not printing? Are you using the Microsoft Graph Chart object?

Are you getting any error messages?



ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
yeah, I'm using the chart object...

unfortunately everything prints out fine except the charts... which come out blank...

there are no errors and the print preview looks fine...
 
I don't have the solution you are looking for, but have you tried printing to another printer to see if the problem may be the printer not being able to create these images?

ProDev, MS Access Applications
Visit me at ==> Contact me at ==>lonniejohnson@prodev.us

May God bless you beyond your imagination!!!
 
Hi, Why not invoke the snapshot viewer. I think you will have to save the snapshot but that doesn't mean you have to keep it...

Private Sub cmdSnp_Click()

Dim FileDir, SnapFile
FileDir = Dir("C:\Snapshots", vbDirectory) 'FileDirectory

If myDir = "" Then
MkDir ("C:\Snapshots")
End If


SnapFile = Dir("C:\Snapshots\Snapshot.snp") 'If a file exists...
If SnapFile <> "" Then
'Delete the file
Kill ("C:\Snapshots\Snapshot.snp")
End If


'output snapshot
DoCmd.OutputTo acOutputReport, "Your Report", acFormatSNP, "C:\Snapshots\SnapShot.snp"

'start viewer and display file

Shell ("c:\program files\common files\microsoft shared\snapshot viewer\snapview.exe C:\Snapshots\Snapshot.snp")

End Sub

- or something along those lines.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top