Printer Dialogue Box (1 Viewer)

Topher

Registered User.
Local time
Today, 16:55
Joined
Apr 18, 2000
Messages
72
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

Registered User.
Local time
Today, 16:55
Joined
Feb 8, 2000
Messages
32
Did you manage to find the solution? If so could you please let me also know.
Regards
Charley
 

Topher

Registered User.
Local time
Today, 16:55
Joined
Apr 18, 2000
Messages
72
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.
 

Topher

Registered User.
Local time
Today, 16:55
Joined
Apr 18, 2000
Messages
72
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

AWF VIP
Local time
Today, 10:55
Joined
Dec 23, 1999
Messages
619
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

Registered User.
Local time
Today, 16:55
Joined
Apr 18, 2000
Messages
72
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

Registered User.
Local time
Today, 16:55
Joined
Apr 18, 2000
Messages
72
sorry i meant acViewPreview not acViewReplace!

oops
 

Users who are viewing this thread

Top Bottom