Steve Turner
sturner at mseco.com
Thu Mar 10 09:12:49 CST 2011
Michael, Thanks for the help. I didn't write the code but my boss did. However after thinking about it and how many records it was accessing well over 600.000 and the query output around 800, I figured that it would be a lot faster to write the all report data to a table and have his save code access that data to write to a file. Accessing the small file seems instantaneous to get a report. This should dramatically speed up the process. First time he ran his code it took over an hour and a half to process the way he was doing it. Steve A. Turner Controller Mid-South Engineering Co. Inc E-Mail: sturner at mseco.com and saturner at mseco.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Wednesday, March 09, 2011 3:45 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Printing reports Steve, I think I'd use a recordset to get all relevant JobIDs and loop through them while altering the AllJobs querydef to change the parameter for JobID. Not sure, though, sounds like you have 'mitigating circumstances.' Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Turner Sent: Wednesday, March 09, 2011 4:32 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Printing reports Michael, It could be but not sure how to do it. We have reports built to print one job, range of jobs, or all jobs. These reports drag data from multiple sources. We built a query to get the current jobs worked on and do a report in "pdf" and output to a file. Then we go get the next number and do it again. However if we could run the all jobs report and then print each page to a "pdf" to file it should save a lot of time. We are trying to go a little greener by filing on the server and not print to paper each page. This also allows all the engineers we have to go and view any job they want. Steve A. Turner Controller Mid-South Engineering Co. Inc E-Mail: sturner at mseco.com and saturner at mseco.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael Mattys Sent: Wednesday, March 09, 2011 3:09 PM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Printing reports Hi Steve, Isn't it simply a matter of filtering a query that the report is based on to the individual JobID and then output each one? Michael R Mattys Business Process Developers www.mattysconsulting.com -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Steve Turner Sent: Wednesday, March 09, 2011 3:39 PM To: accessd at databaseadvisors.com Subject: [AccessD] Printing reports Hey guys, Hope one of you can help us. We generate a list of numbers that are job numbers and print a report for each number. It takes about 2 minutes to generate a report. It then gets written to a directory as a pdf based on the job number. Well this takes quite a while for 50 reports. We can generate a report that has all 50 sheets in it about the same amount of time 2 minutes but we don't know how to print each sheet separately from that report to a file. In Access when you select print you can tell it what page to print. Is there some code that will select the sheet to print so you can set up a loop to go thru all the sheets one at a time? We are using Access 2010 to do this. Here is the code we use to print one sheet to the directory. ' CREATE THE REPORT IN JOB FOLDER ' PDF Format ' strFileReport = "F:\HMS\" & strJobNo & "_" & strReportDate & ".pdf" ' This should write to job file strFileReport = "J:\" & strJobDirectory & "\" & strJobFamily & "\" & strShortJobNo _ & "\0.0 M-S Internal Info\0.9 Labor Recaps\" & strJobNo & "_" & strReportDate & ".pdf" DoCmd.OutputTo acOutputReport, strDocName, acFormatPDF, strFileReport, 0 DoEvents RS.MoveNext Steve A. Turner Controller Mid-South Engineering Co. Inc P.O. Box 1399 Hot Springs, AR 71902 E-Mail: sturner at mseco.com and saturner at mseco.com Phone: (501)321-2276 Fax: (501)321-4750 Cell: (501)282-7751 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com