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

Programatically print snapshot report

Status
Not open for further replies.

PeDa

Technical User
Oct 10, 2002
227
NL
Hello, how can I programatically print an existing snapshot report. I now generate the print and the snapshot separately, but would like to rule out the (theoretical) posibility of changes to the data between the two events by first generating the snapshop and then printing it.

Code:
DoCmd.OpenReport "MyReport"
DoCmd.OutputTo acOutputReport, "MyReport", acFormatSNP, "MyPath.snp"
 
Why not just open and print the report with Snapshot?

You could skip the first DoCmd statement and add , True to the end of your OutputTo statement.

That will open the report in Snapshot from the get-go.

HTH

John

Use what you have,
Learn what you can,
Create what you need.
 
Hello John,

Thank you for the suggestion, however the reports are automatically generated when a particular point is reached, and I want to keep the process automatic (and not depend on the user remembering to print the report).

Peter
 
You can program the snapshot viewer OCX. I
[li]add a reference to the snapshot viewer control to your modules[/li]
[li]add a snapshot viewer control on your form[/li]
[li]add a button to the form to create the snapshot, load it into the control and then print it[/li]
Code:
Private Sub cmdPrintReports_Click()
    Dim strFileName As String
    strFileName = "C:\SnapAuction1.snp"
    DoCmd.OutputTo acReport, "rptAuctionBidSheets", _
        "SnapshotFormat(*.snp)", strFileName, False
    Me.SnapshotViewer.SnapshotPath = strFileName
    Me.SnapshotViewer.Zoom = snapZoomToFit
    Me.SnapshotViewer.PrintSnapshot
End Sub

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thank you Duane. I was just about to try this when it was decided that, after all, we must be able to distinguish between the original print (to be validated by wet ink signature) and the back-up snapshot, so I must return to my original two statements but with a cosmetic difference between the two reports. Thanks anyway.

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top