Print Report from Form

D

Darren

I have been getting weird behavior when printing a report from within a report. The report will either print and all works beautifully or it will blue screen any computer it runs on
I set the code up within the from to open the report in preview mode

DoCmd.OpenReport RepName, acViewPrevie

The Activate event on the report runs this code

DoCmd.PrintOut , 1, 1, acDraft, Form_frmLockoutSelection.TagsToPr
DoCmd.Close acReport, Me.Name, acSaveN

I guess what I am asking is if their is another way to print the report without user intervention (this would mean the not having to click File->Print)

Thanks in advance.
 
N

news.east.earthlink.net

yes. instead of acViewPreview, leave that blank and it will default to
printing the report. remove the rest of the code. Just be sure to set up the
print options and save them with the report.
Darren said:
I have been getting weird behavior when printing a report from within a
report. The report will either print and all works beautifully or it will
blue screen any computer it runs on.
I set the code up within the from to open the report in preview mode:

DoCmd.OpenReport RepName, acViewPreview

The Activate event on the report runs this code:

DoCmd.PrintOut , 1, 1, acDraft, Form_frmLockoutSelection.TagsToPrn
DoCmd.Close acReport, Me.Name, acSaveNo

I guess what I am asking is if their is another way to print the report
without user intervention (this would mean the not having to click
File->Print).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top