Printer options when printing a report?

  • Thread starter Thread starter Aliza Klein
  • Start date Start date
A

Aliza Klein

Hi.

I want to be able to allow the user to print a report (without previewing it
first) directly at the click of a button BUT prior to printing, to allow the
user to select the printer and set any options (similar to selecting
File->Print... from the main menu).

Currently, I have a button that simply does:
DoCmd.OpenReport "MyReport", acViewNormal, etc...

which does not give the user any print options.

Is there a simple way to bring up the Print dialog box (?) and then go ahead
and print the report directly?

Thanks for any info!
Aliza
 
Aliza:

There's no built in way in Access to do that where the action will look
"smooth" to the user. You can run this code to essentially do it, but it
will force the db window up to the top and have a bit of screen flashing as
well.

Docmd.Echo False
Docmd.SelectObject acReport, "MyReport", True
Docmd.RunCommand acCmdPrint
Docmd.SelectObject acForm, "Your Form Name"
Docmd.Echo True

If you want a way to do it a bit more smoothly, then take a look at our "On
the Fly Printing" classes and code which you'll find on our web.
 
I will try it, thanks!

Aliza

SA said:
Aliza:

There's no built in way in Access to do that where the action will look
"smooth" to the user. You can run this code to essentially do it, but it
will force the db window up to the top and have a bit of screen flashing as
well.

Docmd.Echo False
Docmd.SelectObject acReport, "MyReport", True
Docmd.RunCommand acCmdPrint
Docmd.SelectObject acForm, "Your Form Name"
Docmd.Echo True

If you want a way to do it a bit more smoothly, then take a look at our "On
the Fly Printing" classes and code which you'll find on our web.
 
Back
Top