Printing a report directly from form

JaredNJames

Registered User.
Local time
Today, 00:21
Joined
Jul 7, 2007
Messages
87
hi, i have button on a form which prints a report.

can anyone post the code required to get the report to print.

report name : qry_invoice

i just cant suss it out.

my current code is:
DoCmd.OpenReport "qry_invoice", acViewPreview, , , acHidden
DoCmd.RunCommand acCmdPrint

but that just prints the form.

Jared James
 
Have you tried: DoCmd.OpenReport "qry_invoice"
 
Please don't post the same question more than once
 
hi, apologies for that, had to update some details to make it clearer for you.

my mistake.

jjames
 
hi, i have button on a form which prints a report.

can anyone post the code required to get the report to print.

report name : qry_invoice

i just cant suss it out.

my current code is:
DoCmd.OpenReport "qry_invoice", acViewPreview, , , acHidden
DoCmd.RunCommand acCmdPrint

but that just prints the form.

Jared James


Jared-

Use "acViewNormal" rather than "acViewPreview":

DoCmd.OpenReport "qry_invoice", acViewNormal, , , acHidden

Just write this one single line of code, and your report will quietly print without displaying on screen. Hope this helps.



Thooom
 

Users who are viewing this thread

Back
Top Bottom