Printing A Report Query Using A "print" Button On Form

Mar 7, 2008

Hello everyone,

How can i have a form with a "Print" button on it for print a report instead of going to file, print?

I will appreciate if a sample of such database can also be attached.

Stay well.

View Replies


ADVERTISEMENT

General :: Button On Form To Print Current Record - Open Preview Before Printing?

Sep 11, 2013

I have a button on a FORM to print the current record with the following code:

DoCmd.RunCommand acCmdSelectRecord
DoCmd.PrintOut acSelection

But what I need is that before printing, open the preview to set the margins and page size ... or at least to pre-configure so that when you press the button, and comes preformatted.

View 2 Replies View Related

Reports :: Printing Report To PDF File Via Button On Search Form?

Aug 7, 2014

I'm building an application to record engineer input in Events (jobs) for an engineering company.

My main tables are Products, Builds and Events, together with fifty or so reference and ancillary tables which aren't really relevant to this particular head-scratcher.

A Build is derived from a Product and an Event is applied to a Build. An Event includes a sale, a service, a warranty repair and so on. Over time, multiple Events will be logged against a Build.

I have a searchable Events form (Search_Events), containing a subform (Search_Events_sub) whose contents dynamically change to reflect data entered in a variety of unbound fields in the main Events search form. Needless to say, the glue that holds things together is the Event_ID field.

On my Search_Events form, I'd like to place two buttons (Rpt_Event_client and Rpt_Event_internal) which will allow the user to print either a client or an internal copy of the event in question. The reason I want to use separate buttons rather than one button for both copies is that it's quite likely that different engineers will work on different parts of an Event's build, test and sign off process, and will want to print off and annotate the internal report, whereas only the final report will be sent to the client. Also, there will be some slight differences between the visible fields on each report (time and materials logged etc).

So far, I've managed to get the Rpt_Event_internal button to open the relevant Event report in preview mode, using the following on the button's 'on click' event:

DoCmd.OpenReport "Rpt_Event_internal", acViewPreview, "", "[Event_ID]=[Forms]![Search_Events]![Sub].[Form]![s_Event_ID]", acWindowNormal, ""

(In the subform, Event_ID is referenced as s_Event_ID because I'm using an nZ function in most of the search fields so that the results filter dynamically)

So far, so good: this works fine. However, from a usability perspective, and based on the fact that this will be the most-used feature, I'd really like to be able to have the button do the following:

- print the relevant report, based on Event_ID as above to a PDF file

- synthesise the filename of the report along the lines of "Event_" & [Event_ID] & "_Client_Copy_" & [Date()] & ".pdf"

- and to then have the standard 'save as' Windows location browser/file explorer dialogue box appear so the user can choose where to save the file. I don't want the filepath to be hardwired, rather I need the users to be able to decide where to save the file.

I'm using Access 2013.

View 3 Replies View Related

VBA Print 5 Copies Of Report Via Button On The Form

Nov 1, 2011

I am trying to print 5 copies of the report via the button on the form.

I'm sure I have the code correct, however I only prints 1 copy instead of 5.

View 1 Replies View Related

General :: Button To Print A Report Based On Text Box Values On Form

Jul 11, 2015

Im using a button to print a report based on a text box values on the form.the code for which is below

Code:

Private Sub SaveBtn_Click()
DoCmd.SetWarnings False
DoCmd.RunSQL "Update BookInTable SET DateBookedOut = '" & Me!DateTxt & "' WHERE BarCode ='" & Me![BarTxt] & "'"
DoCmd.RunSQL "Update BookInTable SET BookedOut = True WHERE BarCode ='" & Me![BarTxt] & "'"
DoCmd.OpenReport "Labels", acViewNormal
DoCmd.PrintOut , , , , 1
DoCmd.Close acReport, "Labels", acSaveNo
DoCmd.SetWarnings True
End Sub

The problem that I am getting is not only is the label printing but so is the form.

View 3 Replies View Related

Forms :: Added A Print Button To Form To Send Report To Printer

Feb 10, 2014

I have a project which produces a report of names, addresses, etc. I added a print button to the form to send the report to the printer. The code is as follows:

Private Sub Command32_Click()
Docmd.SetWarnings False
'Docmd.OpenReport "rptAddresses", acViewNormal
Docmd.RunCommand acCmdPrint
Docmd.SetWarnings True
End Sub

Both alternatives in the code produce the same result described following.However, the printed report includes only the first 2 colums of about 10 of the 90 plus records. If I send to to a PDF, it works fine. If I do a print view on the screen ir looks fine.

View 1 Replies View Related

General :: Printing Report From Print Preview With Ribbon

Jul 3, 2014

I have report that i have in preview. In that report i have ribbon that has buttons close and print. Close works fine, with print it goes ok but when "printer selection" comes, i try to change printer it informs that not enough memory. All this code that is in ribbon buttons is in VBA.

What could be the reason for memory stuff or how could this be made that this inform wouldn't come.

Code below:
Sub EnnakkoMyButtonCallbackOnAction(control As IRibbonControl)
Select Case control.ID
Case "MyBtn1"
DoCmd.OpenReport "Tuotanto Ennakko", acViewPreview

[Code] ....

View 5 Replies View Related

Modules & VBA :: Print Preview Button On Main Form That Previews Current Record In A Separate Report

Jan 25, 2014

I have VBA code for a Print Preview button on the main form that previews the current record in a separate Report using this code:

Code:
Private Sub cmdPrintRecord_Click()
Dim strWhere As String

If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If

[code]....

I use this Print Preview code on a Button in the Form Header. The Main form lists head of household information. I also have a tabbed control with three tabs that have SubForms for Address, Children and Contact details. The problem I have is that if any of the subforms are left blank I get a Run-Time Error '3021': No Current Record. If I Debug (press the button), it takes me straight to this line:

Code:
varAge = DateDiff("yyyy", varBirthDate, Now)

highlighted in Yellow.Anyone on my database must have an address, should have contact details and could have children. If any one of these is blank then the print preview will not work.I would like to know how to stop this error happening for blank records in my subforms.

View 11 Replies View Related

Reports :: Multiple Report Printing From One Button

May 13, 2014

I'm trying to print out several reports from one button. I have created individual buttons for each of the reports and they work fine.

But when I try to amalgamate them it stops printing after the first two reports regardless of which ones are at the top of the list.

The code I'm using is ......

Private Sub Print_All_Click()
Dim strFilter As String
strFilter = "Business_ID = Forms!frm_Business!Business_ID"
DoCmd.OpenReport "rpt_Front_Page", acPrint, , strFilter
DoCmd.OpenReport "rpt_D_and_N_Suitability", acPrint, , strFilter

[Code] .....

View 5 Replies View Related

Printing Report Setup Button Not Working

Jul 22, 2014

I get an error message when I click the setup button in the print dialog window.

View 10 Replies View Related

Reports :: Print Preview Sometimes Printing Background Form

Apr 22, 2015

I have a form that that contains a button that opens a report. The code I use to open said report is:

Code : DoCmd.OpenReport "Comp and NB Targets Q4", acViewPreview, , strWhere

The issue is that occasionally when the user prints from that preview, it can instead print out the form in the background that was used to open the report.

This seems to happen at random and I have not yet found a pattern or solution to the problem.

Is there a reason this could be happening and is there anyway to stop it?

View 5 Replies View Related

Modules & VBA :: Command Button To Print Report To PDF And Email

Aug 9, 2013

A command button on a form that can:

1- Open the Report called : ConsentForm
2- Print it to PDF printer (report is currently defaulted to that printer driver)
3- Save to folder: C:SOSConsentForms
4- Save as: Consent_[Last]_[First] (these are field names on the form)
Result i.e.: C:SOSConsentFormsConsent_Doe_John
5- Then send the file by email (Outlook) to : abc@hotmail.com

View 14 Replies View Related

Using Expressions And Current ID Of A Form To Create A Query And Print A Report

Mar 6, 2013

I want to have Access run a query, open a report, and print the report based on the ID number of the form that I have open. Is this possible?

The situation would be, I have a form that uses the the primary key as a record number. After I enter the data into the form, with the form open I want to add a button to open and print a report of the current record number.

View 3 Replies View Related

Reports :: Print Report / Disable Restore Button - Inconsistencies

Dec 3, 2014

I have a database with several reports that get constantly printed, however I am having an issue with their display properties that sometimes cause errors.I need the report to come up on top of everything, maximized and with the menu bar available to allow for it to be printed or close it. The report window cannot have "minimize" or "restore" available to make sure nobody access any form behind it.

To achieve this in a form I generally use the modal property, however if I do this in a report I cannot get to the menu bar to print or close the print preview.Thinking that modal was out of the question, I went ahead and maximized the report on load and set its properties to the image attached. The db is then compiled (accde) and then distributed.

On my computer (it is being developed on my machine) the report loads fine (maximized) with no min, max or restore buttons and the print preview menu bar is shown with the print and close buttons available. See "My PC" image attached.On any other computer, the report opens up maximized but the report's restore and close buttons are enabled, however the print and close buttons on the print preview menu bar are greyed out. See "Other PC" image attached.Why the inconsistent behaviour when using the same front end?

View 5 Replies View Related

Reports :: Adding Button To A Report That Shows Print Preview

Jun 13, 2013

I added a "print preview" button to a report that does just that, shows the print preview. The issue I'm having is that I can't do anything in Access after I click that button. Everything in Access seems to stop working, I can't click on anything with my mouse. the only thing that does anything is that i can move the report up and down with the up/down/left/right keys. If I click on a different application that isn't Access (i.e. excel, spotify, email, etc.) and then go back to it, everything works fine.

View 4 Replies View Related

Reports :: Unbound Report - Print Preview OK But None Of Fields Print When Report Directly Send To Printer

May 25, 2013

I have an unbound form with an associated report. When the user hits the 'print' button on the form/screen, the report is launched in the background. In the On Load event of the report I populate the report fields from the forms field as so:

Code:
Me.txtAddrMainLine2 = "NAME " & UCase([Forms]![frm_OrderRx].[txtPatientName])

This works like a charm as long as I call the report in Print Preview mode (i.e. with acViewPreview). But if I send the report directly to the printer, none of the fields print.

I've read about using other report events to populate the fields (e.g., On Format and On Print) and also something about using TempVars to pass the data. But I haven't read anything that's clear and definitive about the full answer.

View 3 Replies View Related

Queries :: Printing Query Results Using A Button

May 10, 2013

I have a form that is set to display the results of a query into a subform... How can I get those results to a printer using a button. I don't need it to print the form just all the results that are in the subform.

View 3 Replies View Related

Print Button On Form.

Apr 28, 2005

Hi... being extremely new to Access, i am sitting here frustrated as anything trying to make this work. I will attempt to explain what I am trying to do.

I have a form that has a combo box in it. This combo box references a table and pulls in the data depending on the company that is selected. What I am trying to do is add a print button on the form, so that the users can print off an address label. Now I can use the normal print report feature and this prints of the entire report, but what i would really like is the print button just to print the fields I want and not the whole thing. The fields I want to print are.

Name_1
Delievery_Address_1
Delievery_Address_2
Delievery_Address_3
Postcode

Ive had a look in the event field for the print button, but I have no idea of the commands to make it only select the fields that I want to print.

I truly am lost, and seeking guidance from the masters here at Access World.

My printing problem is in your hands.... cheers Paull

View 3 Replies View Related

Reports :: Automate Printing From A Command Button With Selected Data From A Query?

Jul 15, 2013

How can I automate different printers for different reports on the same MS Access 2007 database, without having to select the printer each time?

There are two reports that are printed on the same database. Previously, I had automated form buttons to print the reports, without having to select the printer each time. This was about 8 years ago, but I don't remember how I did this. Also, I don't know SQL. Nothing against code, but I did not know how to program, and just MS Access 2007 access itself.

View 6 Replies View Related

Forms :: Adding A Button To Print Form?

Feb 11, 2015

I would like to add a button to a form that will print the form with the current record in it. Also, to add a level of difficulty, there are 8 subforms attached to the form. As I already have the form developed, I don't want to reinvent the wheel and go off and create a report with 8 subreports. Is this possible? If so, Can we force all the data on the form to one page?

View 1 Replies View Related

Printing A Report From A Form

Aug 30, 2006

Hi

I'm pretty new to all of this. I've set up a simple database. I have a form in it for inputting information and then there is a command button on the bottom which prints out a report I've created with the information on it. This is all working great except it prints evey record and I only want the current record printed out.

I've tried the help and it goes into detail about OpenReport and PrintOut in macros. I have no idea what a macro is or what to do with it.

Can anybody please help me and give me step by step instructions as to how to print out only the current record in the report from the command button.

Your help is greatly appreciated:)

View 1 Replies View Related

Printing A Form To A Report

Nov 1, 2006

I have a form (entry screen to enter data) I then created a report in the layout I need for my order form. I want to creat a button that a user can press and it will print the current record to the report (order form layout)

Here is my current code for the print button on the form page:
Private Sub btnPrtOrderFrm_Click()
On Error GoTo Err_btnPrtOrderFrm_Click

Dim stDocName As String

stDocName = "rptOrders2"
DoCmd.OpenReport stDocName, acNormal

Exit_btnPrtOrderFrm_Click:
Exit Sub

Err_btnPrtOrderFrm_Click:
MsgBox Err.Description
Resume Exit_btnPrtOrderFrm_Click

End Sub

The only problem is when I tell it to print if I am on record number 2 on the form, it prints both record 1 and record 2. I only want the current record i am in to print. Any ideas much appreciated

Dean

View 2 Replies View Related

Printing Report From Form

Jul 28, 2006

I had made my own database for my own business.

I am trying to print a report from a form. Once i enter an order detail i finish off by printing a letter. At the moment we are doing this via a query by entering the order id.

I want to automate this so for the form record i am in i want a button to print a report for that record only.

I know this can be done as i rember doing this in college but i cant get my head round it at the moment.

Please help

View 2 Replies View Related

Printing Report From Form

Jan 3, 2010

I am able to print a report of all records from a command button on a form with

DoCmd.OpenReport "General Input Info", acViewPreview

I can also print just the current form to the report with

DoCmd.OpenReport "General Input Info", acViewPreview [ID] = & [ID].

What I would like to do is print a report showing the current form and all the forms after that form. In other words, none of the records previous to the current form listed but do show the current record and all others after that as determined by the auto number ID field. I am able to filter by form in the ID field with >45 showing me all records with an ID of 46 and above but I want to be able simply print the report from the command button that is on the form.

View 8 Replies View Related

Printing Report Without Refreshing The Form

Jul 27, 2006

Okay, here is the situation that is slowly driving me crazy.Form: Clients ACTIVESubform: Clients ACTIVE - closureReport: Clients ACTIVE - closure (created by a save as by the subform)My database was created to keep track of clients in a centre. The clients files are eventually closed by a checkbox. Then a number of reasons are inputted in as for why the file is now closed by means of a combo box (lost contact, graduated, etc). After the files are closed, the users want to print a simple one-page report that they can put in their manual (paper) file. I created a subform that allows the users to preview what will be on the resulting report. I also created a button that they can click to print the report.NOW for the problem,The report will not show the new information (closed checkbox = yes, reason for closure, notes about closure, etc). I can't refresh because then the client no longer shows up in the form as it only includes ACTIVE aka open files aka Closed=No.Here is my coding for the button that I have:Private Sub Closure_Click()On Error GoTo Err_Printable_Click Dim stDocName As String stDocName = "Clients ACTIVE - closure" stLinkCriteria = "[StudentNumber]=" & "'" & Me![StudentNumber] & "'" DoCmd.OpenReport stDocName, acNormal, , stLinkCriteria Exit_Printable_Click: Exit SubErr_Printable_Click: MsgBox Err.Description Resume Exit_Printable_ClickEnd SubHELP ANYONE??? :) My only idea is to do this is something like where is matches the student numbers, refreshes the form, and prints the report. BUT no matter where I put the refresh or requery command, it doesn't work. It ends up printing a blank report as it can not find the student number in the ACTIVE form as the client is now closed.

View 1 Replies View Related

Forms :: Why Is Form Printing Instead Of Report

Jan 7, 2015

My Main Form is a Popup Window with print button for other subforms. So I have it set so when the Report opens it hides the Main Form, and I use the

Code:
DoCmd.SelectObject acReport, Reports(0).Name, True

do get focus to Report, and I run a loop just to make sure it does actually have focus and the Main Form does not have focus.On my PC It works great it prints the report every single time, but when my colleagues are using it... it prints the Main Form instead of the report. I don't get why it would work on my PC, but not work on someone elses?

Code:
Public Sub FocusOnReport()
Dim intState As Integer
Dim intCurrentType As Integer
Dim strCurrentName As String

[code]...

How can I make sure it prints the report and not the MainMenu

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved