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 / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

DoCmd.OpenReport, Print to Adobe Timing Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike C - 27 Sep 2006 21:25 GMT
Hi. I have some code that loops through some items and prints out a pdf for
each item. My printer is defaulted to Adobe. This usually works just fine.
However, I now have  a pretty big report that's composed of about 20
subreports. When I try to print the report using the code excerpt below, it
seems as if the code is executing before the report actually prints using the
Acrobat distiller. Any thoughts? Thanks!!

DoCmd.OpenReport "ProductSummary", acViewNormal
DoCmd.Close acReport, "ProductSummary", acSaveYes
Tom Wickerath - 28 Sep 2006 09:51 GMT
Hi Mike,

I don't know if this will work, but have you tried using a DoEvents statement?

   DoCmd.OpenReport "ProductSummary", acViewNormal
   DoEvents
   DoCmd.Close acReport, "ProductSummary", acSaveYes

or, possibly this:

   Dim i as integer
   DoCmd.OpenReport "ProductSummary", acViewNormal
   For i = 1 to 50   '<---Experiment with top number
       DoEvents
   Next i
   DoCmd.Close acReport, "ProductSummary", acSaveYes

Another possible fix might be to force the main report to read a value from
your open form, even though you won't use it for anything. In the report's
open event procedure, try something like this:

   Dim strParam As String
   strParam = Forms!NameOfYourForm!NameOfHiddenTextbox

Tom Wickerath
Microsoft Access MVP

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________

> Hi. I have some code that loops through some items and prints out a pdf for
> each item. My printer is defaulted to Adobe. This usually works just fine.
[quoted text clipped - 5 lines]
> DoCmd.OpenReport "ProductSummary", acViewNormal
> DoCmd.Close acReport, "ProductSummary", acSaveYes
 
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.