473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Printing Report without Opening it

15
I have a form that has 5 check boxes as well as two buttons, a preview and a print button. Each checkbox corresponds to a different report. I have the preview button working fine, whatever checkbox is select the report will open showing the user. However when I'm selecing the print button I can get the correct report to print fine but I have to open the report and preview it then it will print. I would like to be able to not even open the report and just print it. I tired the following code:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "BlockStatusRegion4",  acViewPreview, "", "", acHidden
  2. DoCmd.PrintOut acPrintAll
  3. DoCmd.Close acReport, "BlockStatusRegion4"
However it just prints the form that the user selects becasue that is what is displayed. Im not sure how to go about doing this so any help would be great.
Aug 25 '10 #1
2 20844
remove the acViewPreview and it wil default to print. Problem is it will print to the default printer set by access and maybe not the one the current computer has?
Aug 26 '10 #2
dawn123
15
Thanks for the help! I was wondering if you knew if it was possible, when you are export a report to PDF in access 2007 that you could specify the number of pages of the report you want to print. (ie. of a 5 page report only print pages 1-3) I know how to do it manually by going into the Options of the export to PDF but I can seem to find how to do it through vba.
Aug 26 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ken Fine | last post by:
Using ASP, is there an easy way in code to "visit a URL", without opening a browser session? Explanation: I have a page caching class. The page caching class's behavior can effectively be...
2
by: Piyush | last post by:
Hi, I need to print stuff on the default printer on the click of a button without opening the print box opening up. Any pointers?
2
by: Alon | last post by:
Hi, I want to send a table that exist in my page to the printer, without opening a new window. Is it possible? If it is not possible to do this in javascript, can I do it with JSP? Thanks,...
0
by: Adrian | last post by:
Access 2000 I have inherited a database (.adp) that sets the input parameters for reports at run-time. It then saves the report before opening it to display to the user. This is a sample...
4
by: Jelmer | last post by:
Hi I've been trying to create an addin similar to Find & Replace from Rick Fisher that looks thru your tables / queries / forms / modules etc.. for a reference to a string and optionally let's you...
0
by: vinamb2006 | last post by:
yes,Iam using button onclick event. the code is as under 'PrintReport() prtdoc.PrinterSettings.PrinterName = comboInstalledPrinters.SelectedItem.Text Dim...
1
by: sandy21380 | last post by:
Hello, Is there a way of opening an Access form without opening the Access window? Right now when I open the form, the Access window is a lot bigger than the form so I have to resize the Access...
3
by: Suresh P | last post by:
Hi All, I tried to access the mysql database in ODBC using ip address and username/password. It returns, "cannot connect to MySQL server on IP ADDRESS(10060)". This could be related to Firewall...
2
by: rlu | last post by:
Is there a way to print a pdf document without opening it, if user just select the pdf files in the checkbox and click a button? I tried the following two methods, but both fail. 1. open a new...
0
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have problems printing a .rdlc report directly to the printer. I have created such a report without Datasource, I just fill some parameters in this report. With the ReportViewer I am...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
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...
0
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...
0
tracyyun
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...

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.