Topher
04-26-2000, 10:18 AM
I'd like to know how i can print a report but by using the printer dialogue box. how can i bring it up and let the box control how many reports are printed, and where its being printed.....
i know of the docmd.runcommand accmdprint option brings up the dialgue box but how to i use it with a report?
any suggestions??
Topher
chthomas
05-23-2000, 04:02 AM
Did you manage to find the solution? If so could you please let me also know.
Regards
Charley
Topher
05-23-2000, 05:39 AM
The only thing i could figure out was using the docmd command funtion after opening the report in the background. so use the open report in a preview mode and then the command for the printer dialgue box. also i had to use setwarnings false before using the command so access wouldn't bring up a dialgue box when i hit cancel. thats all i could figure out - i know it can be done thru VBA in a better manner but im unsure how.
There is an article (Q129397) that explains how to change printers for a report
http://support.microsoft.com/support/kb/articles/Q129/3/97.asp?LN=EN-US&SD=gn&FR=0
Its a bit involved, best of luck.
Loz
[This message has been edited by Loz (edited 05-23-2000).]
Topher
05-23-2000, 06:58 AM
the code in that article shows you hot you can print the doc thru code. but what we want to do is actually bring up the printer dialogue box. such as the one that comes up when you print from Word. i belive you can make your own by grabing the data using the commands in that article but there must be a more time saving way such as a default printer dialogue box.
R. Hicks
05-23-2000, 04:57 PM
From your form use the following code in an event to open the report:
DoCmd.OpenReport "YourReport", acViewNormal
(YourReport needs to be the actual name of your report)
Then in the report add the following code to the report's On Activate property:
DoCmd.RunCommand acCmdPrint
DoCmd.Close acReport, Me.Name
This will bring up the Print Dialog box to give you your choices, print your selections and close the report, without you viewing the report.
Good Luck,
RDH
[This message has been edited by R. Hicks (edited 05-23-2000).]
Topher
05-24-2000, 05:57 AM
Thanks for the info - i tried what you said and it does print however the dialogue box doesnt appear. i think its because of using the normal mode for opening the report - normal means to print it, right? i replaced the acViewNormal with acViewReplace and it worked!!!
=D
Thanks!
Topher
05-24-2000, 06:17 AM
sorry i meant acViewPreview not acViewReplace!
oops