Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 15th, 2004, 08:58 PM
Authorized User
 
Join Date: Aug 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default report..

hello.. how to print report1 2 copies and 3 copies for report2??

 
Old August 15th, 2004, 09:52 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 625
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to jemacc
Default

Recommendation: Since your reports may change number of requested copies give the user the option of select number of copies instead of hardcoding the value.

Here an article which I have used in the past.

Make Print Dialog Box appear when printing a Report

Open the Report in acPreview with your code ... don't worry, it will not appear on screen if you follow the instructions below.

Add the following to the "On Activate" event of the report.
This will cause the Print Dialog Box to open so you can choose a printer, and also choose the number of copies .... ect.

After you make the choices in the Printer Dialog Box the report will print ... but the code will close the report without it ever appearing on screen.
There is also code here in case the result of the recordset returns "no records" so there's no need to use the On No Data event. It will display a message box that you can alter to fit your needs.

code:--------------------------------------------------------------------------------Private Sub Report_Activate()On Error GoTo Err_Report_ActivateDim strMsg As StringDim strTitle As StringstrMsg = "The Were No Records Returned." & vbCrLf & _ "Print has been Canceled."strTitle = " No Records Returned" If Me.Report.HasData Then DoCmd.RunCommand acCmdPrint DoCmd.Close acReport, Me.NameElse MsgBox strMsg, vbInformation + vbOKOnly, strTitle DoCmd.Close acReport, Me.NameEnd If Err_Report_Activate: Resume Next DoCmd.Close acReport, Me.Name End Sub
--------------------------------------------------------------------------------



--------------------
Ricky Hicks
Birmingham, Alabama USA

go can also build your own macro using the docmd.printout







Similar Threads
Thread Thread Starter Forum Replies Last Post
simple report and crystal report in vb.net saket123 .NET Framework 2.0 0 August 13th, 2008 06:55 AM
reset links main-report to sub-report from c#.net epanyun Crystal Reports 0 April 18th, 2008 02:41 AM
how can i add report to report viewer in asp.net wael_e BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 0 February 19th, 2008 03:19 PM
Login fail Err when view report on Report Server dillig BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 1 July 22nd, 2004 05:31 AM
How to load a Web Server report into a Report Doc dshadle Crystal Reports 3 September 30th, 2003 03:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.