473,583 Members | 3,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Print Reports

(Sorry if I have repeated this, it did not appear the first time)

I have the following code on a button. The idea is that when this button is
clicked it prints several reports automatically then loops through several
other reports and prints them. These reports are not sent to a printer but
sent to a program called Fine Print PDF Factory which turns them into a PDF
file (set as the default printer)

This all works perfectly unless any of the reports have more than about
250-300 pages, if more than this then I occasionally get an error message
saying "Out Of Stack Space" or more often Access just closes in the middle
of a report without any message.

I am concerned about the (rst.Close) part, is this sufficient to return the
system memory? Should there be other specific command to do this? Does
anyone have any suggestions?

I have not tried sending it to a real printer as these reports contain
colour pictures and 300 of them would take a long time to test, I suppose
the problem could be with the PDF Factory but this seems unlikely as I have
printed long Word documents using it.

Many thanks in advance.

Private Sub Command134_Clic k()

On Error GoTo ErrReport

Dim dbs As Database

Dim rst As Recordset

Dim strSQL As String

Set dbs = CurrentDb()

Set rst = dbs.OpenRecords et("PrintDefaul tsAssendingQuer y") ' set to the

'added 7/7/03. print Cover first then Index report before other reports

'Check if any records first

Dim NumRecs As Long

NumRecs = DCount("[SortOrder]", "[TocCountQuery]", "[SortOrder]")

If NumRecs < 1 Then

MsgBox "There is No Data to print from any of the selected reports.",
vbCritical, "Error"

Exit Sub

End If

'Check if Outline Picture has been selected 24/07/03

Dim NumOutline As Long

NumOutline = DCount("[OutlineDrwaingI mpSiteID]", "[OutlineCountQue ry]",
"[OutlineDrwaingI mpSiteID]")

If NumOutline < 1 Then

MsgBox "Please enter the Site Outline Picture before printing reports.",
vbCritical, "Error"

Exit Sub

End If

'print these first

DoCmd.OpenRepor t "SiteOutlineRep ", acNormal, "", "" 'open the reports

DoCmd.OpenRepor t "NameAddressRep ", acNormal, "", ""

DoCmd.OpenRepor t "IndexRep", acNormal, "", "" 'open the reports

With rst


Do Until .EOF

strSQL = rst![ActualName] 'The field name on the query

DoCmd.OpenRepor t strSQL, acNormal, "", "" 'open the reports




End With

Exit_OpenCustRe p_Click:

Exit Sub

ErrReport: 'Error checking

Select Case err

Case 2501 'the open report action was cancelled

Resume Next

Case Else

MsgBox Error$

End Select
Resume Exit_OpenCustRe p_Click

End Sub

Nov 12 '05 #1
0 2254

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: Wendy Elizabeth | last post by:
I would like to know how to print a crystal report that was generated in the ..NET framework using a Visual Basic.NET web application and/or a Visual basic.NET windows application. When crystal reports runs by itself, you can do a print preview to see what the report will look like. I would like to know how to do this using crystal reports...
by: Chuck Reed | last post by:
I have a MS Access data base that creates custom reports for clients in PDF form then prints the reports after all client's reports have been printed. The problem that I have run into is that when acrobat is printing to my printer, I can get it to print only the first page of a report(OPTION 1 BELOW) or it is spooled to the printer then...
by: Jason | last post by:
For some reason, most but not all reports printing from an access application our client is using will not print any images on the reports or forms. One report will print the image and data correctly oddly enough. The image header is embedded using the Insert Image feature and not loaded into a database. I can move the image to anywhere in...
by: Claudia Fong | last post by:
Hi, I have 4 reports created in Ms-access and I will use VB to print those reports. My problem is I'm not sure if I can control wich report to print.. Those reports are almost the same, what is different is the logo in the report header or page header. Because there are 4 different logo. I want the user to choose in VB which logo to use...
by: Frank | last post by:
Guys I have got an exe which takes a printername and file(s) as arguments for printing. This is running fine on the local machine (printing to a network printer from the local machine) Can I put this exe on a server and allow users to print on their networked printers. Should I be doing a web service for this..?
by: Ann | last post by:
I have a C# application that uses PrintDocument and PrintPage to draw reports. Now I need to integrate a tax form printing from a legacy VC++ DLL into the C# application. One of the important requirements is that the printing of the reports (implemented by C#) and the tax form (implemented by VC++) to be on the same print job. For example, if...
by: Rod | last post by:
We've got an old VB6 application which has 9 Crystal Reports it can print. These 9 reports are considered by our users to be in essence one "report", in the sense that they are all related and they cannot make their business plans without all 9 reports. However, they really are 9 separate reports, 7 of which have sub-reports in them. One...
by: EricJudge06 | last post by:
We are converting some reports from Crystal Reports to Microsoft SQL Reporting Services (SSRS) in an ASP 2.0 VB.Net web app. Crystal had a function called PrintToPrinter which was being used to programmatically print to a network printer that we specified in the code as soon as the user clicked a button on the screen. The printer dialog box did...
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to print the report three times, but do not know how
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.