jonesy_33
asked on
Problem outputting access report to .snp
I am having a problem wich I beleive to be an issue with the access runtime environment. I have a form where users can select a report to either print or preview. Print send it striang to the printer and works like a charm. Preview outputs to a .snp file on the users local pc then opens it in the snapshot viewer (see code below) this all works just fine on a pc with the full version of Access however, on a pc with just the runtime environment it appears to be working, but a 10 page report will continue to output pages until I decide to click cancel usually around 6000 pages or so.
'Create A Snapshot of the report.
DoCmd.OutputTo acOutputReport, "rptMonthly_All", "snapshot_ Format", "C:\Temp\rptMonthly_All.sn p" '..... this saves your report as snapshot
'then open your form with a snapshot viewer control on it ...
DoCmd.OpenForm "frmReport"
'load the snapshot fiel into the viewer control
Forms("frmReport").Control s("Snapsho tViewer2") .SnapshotP ath_ = "C:\Temp\rptMonthlyVBH_.sn p"
'Create A Snapshot of the report.
DoCmd.OutputTo acOutputReport, "rptMonthly_All", "snapshot_ Format", "C:\Temp\rptMonthly_All.sn
'then open your form with a snapshot viewer control on it ...
DoCmd.OpenForm "frmReport"
'load the snapshot fiel into the viewer control
Forms("frmReport").Control
Probably because of the syntax. Here is syntax I use. Try it.
DoCmd.OutputTo acOutputReport, "rptMonthly_All", acFormatSNP, "C:\Temp\rptMonthly_All.sn p" , False
DoCmd.OutputTo acOutputReport, "rptMonthly_All", acFormatSNP, "C:\Temp\rptMonthly_All.sn
ASKER
After further testing I think it is because of the printer. The user's pc's using the runtime environment they connect to the printer through a print server. However, when I load the drivers, like I was adding a local printer the problem disappears. if I remove all printers from the PC the problem comes back.
Do you know of the snapshot viewer requiring a local printer??
Do you know of the snapshot viewer requiring a local printer??
ASKER
just found the answer to my own question; http://www.totalmetrics.com/cms/servlet/main2?Subject=Content&ID=807
It appears that the snapshot viewer does require a default printer and the way I code the printing of the reports sometimes leaves the printers without a default (not sure how or why), but if that happens and then the user goes to preview a report using the snapshot viewer then they will have the issue in my original posting, but if they go in to Printers and FAX's and assign one then it works fine. Kind of a hassel, but they will have to deal till I can debug..
It appears that the snapshot viewer does require a default printer and the way I code the printing of the reports sometimes leaves the printers without a default (not sure how or why), but if that happens and then the user goes to preview a report using the snapshot viewer then they will have the issue in my original posting, but if they go in to Printers and FAX's and assign one then it works fine. Kind of a hassel, but they will have to deal till I can debug..
ASKER
How do I close a question I answered myself other than the obvious answer of never asking it in the first place??
Contact community support and request that they close out the question and refund your points.
No objection.
PDB
PDB
ASKER
works for me, it would be nice if it was just closed. That way if others come across the same issue maybe it could be of use.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER