Topics Search

Command button on Report to Print the Report

Command button on Report to Print the Report
Views: 183
I just need to know the code or what I need to do to put a comman button on an actual report through which a click of that button will send it to the printer. I tried to make a macro to run from a hiddent button on a report, but there is no option for printing a macro. Therefore I guess I need the code.

Lets assume the following below.

Report = [Report Name]
Query = [Repot Name]
Button =[Command Button
Sponsored Links:

More topics

 

Print a report without displaying print preview

Preview
I have several forms which have a print button (created with the command button wizard, report operations, print report, then relevant report is chosen to print). This works great, and prints the relevant report for the the associated record, however when you click the print button it also displays the print preview and doesn't close it again. This means that until the preview is closed the same thing keeps printing when the button is clicked.

but I've managed to looked in the button's properties, and it's created a macro - runcommand, print. When you click on that line there is a description called view from which you can choose either print, design, preview, layout etc, I've tried changing it to all of the other options, but the only one that makes the report work is preview.
 

Print button problems

Preview
I have made a report ("Timings Report") which opens on the click of a button from a separate form ("Progress Form"). The report has a print button which opens the print dialog box for the user.

The problem I am having is concerning the button on my form - when I click it, instead of opening the report, it just automatically prints the report. The code for click command on both is below.
....

Another problem I have been having with the code (which isn't as major) is on printing, the print command button still prints. I have tried using the cmdPrint.Visible = False statement butI just get an error: "You can't hide a control that has the focus."
 

Button that had open report command only try and print on click?

Preview
I have a button on a form that I would like to have open a report. In the button's on click event I have coded this:

Private Sub instrument_index_button_Click()
DoCmd.OpenReport ("rInstrumentIndex")
End Sub

When I click the button it tries to print the report. Is there more to the command that I need to get this to work the way I want?
 

Report Printing Problem

Preview
I have an Access 2010 Database. I use a form to set parameters for a number of reports including a combo box to select which report to print. When the user clicks on the command button the report is generated in Print Preview and when satisfied the user clicks on the print button. The issue is that the report is not printed the form is printed?
 

Printing report from command button in color

Preview
I have the following code for a command button to print the designated report. The print job goes directly to the printer and prints in black ink only. How can I have the print job automatically print in color, or have the print promt come up for the user to choose black ink or color.

Private Sub Command54_Click
 

Generating next report

Preview
I am trying to make (print) an invoice based on a work order. I have looked through some examples but am missing something. I have put a command button in to print a report but I don't know how to load the report with the new record. I am assuming I do this using a query some how?
 

Need to print a Report

Preview
I made a form where I added to command buttons. The user is supposed to be able to click the command button and have the report Print. I was right-clicking on the command button and I was trying to write the code, but I am very new at this, so I think I messed it up worse. I was trying to also build a Macros and use the PrintOut command, but I could not get it done.

If someone can help me to either build a macros or write the code, I would like to first use the OpenReport command and then the PrintOut command. I just do not know how
 

Open a Report by Command button

Preview
I currently have the following code in an event procedure that by clicking a command button the following happens. the code below opens up a report in Print preview and not the regular report view. How do I change the code so that by clicking the command button, the regular report view (green folder) is opened.

Private Sub Command7_Click()
DoCmd.OpenReport "TRI Chemical Purchases", acViewPreview
 

Print different Reports at once

Preview
I have three different reports that I like to print at once by a command button on my form. The reason is that the report only holds 22 inches of information on it so I had to split it up into three different reports.

The first report is the one that prints by the ID and the rest just has information that relates to the first report I.e., Definitions etc.

I have created a macro but I can't get it to run properly.
This is how I got the macro setup:
OpenReport | first report by ID
OpenReport | Second report IRB Section
OpenReport | Third report definitions
Runcommand Print Preview
 

Print vs. Print Preview

Preview
I am adding a report to an Access 2007 Db that will end up being a Runtime version. On the switchboard (actually a form I'm using as my switchboard) I have a button to print this report.

Here's the problem. When I click the button to print the report, it opens the report in "Print Preview", but I'm seeing a blank report and a Print window. if I click on "Print", the report prints AND I get to see the Print Preview.

However, if I click on "Cancel", I am allowed to see the Print Preview, but have then lost theability to Print.

What I was hoping was that the Print Preview would open so my users might decide if they wish to print or cancel.