Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / April 2007

Tip: Looking for answers? Try searching our database.

Report Printing

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sharkbyte - 30 Apr 2007 20:40 GMT
I'm sure this has been answered before, but I was unable to glean the answer
from the archives.

I'm having a problem with reports where after the report is opened in
Preview mode, the code continues to run.  Is there a setting that will stop
the code until the report has been closed?

Second, and this may resolve the first issue, is it possible to open the
report in Preview and then call the Print Dialog, to allow the user to select
the quantity to print?  I would think, in this case, the code breaks until
the Print Dialog is closed.  But I may be mistaken.

Thanks, in advance.

Sharkbyte
fredg - 30 Apr 2007 21:24 GMT
> I'm sure this has been answered before, but I was unable to glean the answer
> from the archives.
>
> I'm having a problem with reports where after the report is opened in
> Preview mode, the code continues to run.  Is there a setting that will stop
> the code until the report has been closed?


What code? What does it do?

You can open the report in acDialog (Access 2000 or newer).
DoCmd.OpenReport "ReportName", acViewPreview, , , acDialog
But then you must close the report before anything else happens.

> Second, and this may resolve the first issue, is it possible to open the
> report in Preview and then call the Print Dialog, to allow the user to select
[quoted text clipped - 4 lines]
>
> Sharkbyte

You can use the SelectObject method along with the PrintOut method to
select either a report already open in preview or not open along with
the PrintOut method to display select how many copies to print:

To print a report not open:

DoCmd.SelectObject acReport, "ReportName",True
DoCmd.PrintOut , , , , InputBox("How many Copies?",,1)

To print a report already opened in Preview:

DoCmd.OpenReport "ReportName", acViewPreview
DoCmd.SelectObject acReport, "ReportName", False
DoCmd.PrintOut , , , , InputBox("How many Copies?",,1)

Note: The above uses an InputBox for quantity selection.
I would suggest an unbound control on the form instead.
Refer to the form control using:

DoCmd.PrintOut , , , , Me.ControlName

Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.