Print record in form.

  • Thread starter Thread starter Arne Olsson
  • Start date Start date
A

Arne Olsson

Hi!
I,m working on a way to print the active record in a form using the design i
made in a report without showing the report for the user and i would like to
send the user to the printer selection so he can decide printer. I have tried
this with the code below but the problem is that the acviewPrview shows the
report and that will only confuse the enduser. The end user should feel that
he can print the information in the form on the printer he decides. Is this
possible to solve?

DoCmd.OpenReport "PrintReport", acViewPreview, , _
"[Ärendenummer]=[Forms]![frm1]![Ärendenummer]"
DoCmd.RunCommand acCmdPrintSelection
 
Arne Olsson said:
Hi!
I,m working on a way to print the active record in a form using the design
i
made in a report without showing the report for the user and i would like
to
send the user to the printer selection so he can decide printer. I have
tried
this with the code below but the problem is that the acviewPrview shows
the
report and that will only confuse the enduser. The end user should feel
that
he can print the information in the form on the printer he decides. Is
this
possible to solve?

DoCmd.OpenReport "PrintReport", acViewPreview, , _
"[Ärendenummer]=[Forms]![frm1]![Ärendenummer]"
DoCmd.RunCommand acCmdPrintSelection

Please see:

http://www.smccall.demon.co.uk/Reports.htm#SetDevice

which will do the whole job for you, including filling a combo or list box
with printer names to select from.
 
Stuart's method is much easier if you have Access 2002 (XP) or later.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

Arvin Meyer said:
From Access Help Files:

You can use the PrtDevMode property to set or return printing device mode
information specified for a form or report in the Print dialog box.

Here's a URL for more detail information on this property.

http://msdn.microsoft.com/en-us/library/aa173220(office.11).aspx
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com



Arne Olsson said:
Hi!
I,m working on a way to print the active record in a form using the
design i
made in a report without showing the report for the user and i would like
to
send the user to the printer selection so he can decide printer. I have
tried
this with the code below but the problem is that the acviewPrview shows
the
report and that will only confuse the enduser. The end user should feel
that
he can print the information in the form on the printer he decides. Is
this
possible to solve?

DoCmd.OpenReport "PrintReport", acViewPreview, , _
"[Ärendenummer]=[Forms]![frm1]![Ärendenummer]"
DoCmd.RunCommand acCmdPrintSelection
 
Back
Top