Printer Dialog Box

  • Thread starter Thread starter Bernie
  • Start date Start date
B

Bernie

I would like to have a command button with VBA code to:
1. Open a report in Print Preview
2. Open the Printer Dialog Box (so the user can select
the printer for printing the report).

I have no problem with 1. I do not know how to accomplish
2.

Thanks,
Bernie
 
I would like to have a command button with VBA code to:
1. Open a report in Print Preview
2. Open the Printer Dialog Box (so the user can select
the printer for printing the report).

I have no problem with 1. I do not know how to accomplish
2.

Thanks,
Bernie

You can use this in the code...

DoCmd.RunCommand acCmdPrint

- Jim
 
Maybe I don't have this written in the correct order. The
code is opening the report, printing direct to the default
printer, then opening the printer dialog box. How can I
get the code to stop the middle step---printing directly?

Thank you for your help.
Bernie

Code:
If Me![Selection] = "All Attributes for Change Notice" And
Me![Option] = "View Report" Then
DoCmd.OpenReport "Rpt-CN-All",
acViewPreview, , "[Change Number]=" & "'" & Forms![Frm-CN-
Tabs]![Change Number] & "'", acWindowNormal
DoCmd.Close acForm, "FrmPrintOptions"
DoCmd.SelectObject acReport, "Rpt-CN-ALL"
 
Sorry, I forgot to include the LAST line...which is the
DoCmd.RunCommand acCmdPrint.

Bernie
-----Original Message-----
Maybe I don't have this written in the correct order. The
code is opening the report, printing direct to the default
printer, then opening the printer dialog box. How can I
get the code to stop the middle step---printing directly?

Thank you for your help.
Bernie

Code:
If Me![Selection] = "All Attributes for Change Notice" And
Me![Option] = "View Report" Then
DoCmd.OpenReport "Rpt-CN-All",
acViewPreview, , "[Change Number]=" & "'" & Forms![Frm-CN-
Tabs]![Change Number] & "'", acWindowNormal
DoCmd.Close acForm, "FrmPrintOptions"
DoCmd.SelectObject acReport, "Rpt-CN-ALL"
-----Original Message-----


You can use this in the code...

DoCmd.RunCommand acCmdPrint

- Jim
.
.
 
Hmm, that looks OK. I'm not sure about the last argument for
OpenReport - acWindowNormal. You might try omitting that and see what
you get.

- Jim

Sorry, I forgot to include the LAST line...which is the
DoCmd.RunCommand acCmdPrint.

Bernie
-----Original Message-----
Maybe I don't have this written in the correct order. The
code is opening the report, printing direct to the default
printer, then opening the printer dialog box. How can I
get the code to stop the middle step---printing directly?

Thank you for your help.
Bernie

Code:
If Me![Selection] = "All Attributes for Change Notice" And
Me![Option] = "View Report" Then
DoCmd.OpenReport "Rpt-CN-All",
acViewPreview, , "[Change Number]=" & "'" & Forms![Frm-CN-
Tabs]![Change Number] & "'", acWindowNormal
DoCmd.Close acForm, "FrmPrintOptions"
DoCmd.SelectObject acReport, "Rpt-CN-ALL"
-----Original Message-----
On Fri, 9 Jan 2004 10:36:12 -0800, "Bernie"

I would like to have a command button with VBA code to:
1. Open a report in Print Preview
2. Open the Printer Dialog Box (so the user can select
the printer for printing the report).

I have no problem with 1. I do not know how to accomplish
2.

Thanks,
Bernie

You can use this in the code...

DoCmd.RunCommand acCmdPrint

- Jim
.
.
 
Back
Top