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 Replies


ADVERTISEMENT

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

I Want To Print A Report And Programmatically Set The Printer Name And 'Print To File

Jul 16, 2007

How can I print a report and at the same time programatically set the printer name and 'Print to File' option and set the path of this option?

View 1 Replies View Related

Modules & VBA :: Can Send A Report Directly To Printer From Code

May 19, 2014

Can you send a report directly to the printer? We have Clients with multiple Contact Notes, by multiple Clinicians, each of these are separate tables. Every month we print two reports for each client that had at least one contact in that date-range. Usually 200 clients, takes a lot of time. My approach so far is a query within a make-table query to get a list of unique client ID's that had one contact in the date-range. Then I use that table in code to create a recordset, use a Do Loop within that where I print the two reports for the 1st client, move to next record and loop. Now that I've got it working I'm not sure how to print all the reports My 1st question, can you send a report directly to the printer from code? The printer is a networked Konica Minolta Biz-hub so I think it can handle that many jobs being queued that fast.

View 4 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

Modules & VBA :: Can't Print Form Image To This Type Of Printer

Jul 25, 2013

I have an application (2007 accde) that has been working for some time, this line specifically:

Application.FollowHyperlink Me.txtAttachment

On one users PC (XP Pro SP3), this has worked from day one. His PC got infected to the point that I had to wipe/rebuild it, and suddenly this code throws a warning and then an error. The warning I could live with (it's the MS Office "some files can contain viruses..." warning). However, after clicking on OK for the warning, I get an error that says "Can't print form image to this type of printer". Doesn't make sense, as this user has the same default printer he had before, plus I tried with a different default printer.

if I navigate to the file location on his PC I can open any of the files, so I don't think it's a permissions issue. The code works fine on my PC and a VM with a different OS, and it still works fine for other users.

View 6 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

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

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 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 6 Replies View Related

Printer Dialog Box Before PRINT

Nov 15, 2006

Hi,

I used the code below to hide all the toolbars and then created my custom ReportToolbar so the user can print the report. All works OK; however, the PRINT button on my custom toolbar sends the report imidiately to the printer. How can I create a button that I could add to my custom toolbox which would open the dialog box that allows to choose the printer, number of pages to print, etc.. (same action as I can get by going to File->Print)?

PS> Also, is there any way to remove the drop down arrow from my custom toolbox? I disabled Customize Toolbox but the pulldown arrow still appears. I found making an MDE would take care of this, but was wondering if there was another solution.

Code used to hide toolbars:For i = 1 To CommandBars.Count
CommandBars(i).Enabled = False
Next i

View 3 Replies View Related

Forms :: Print Single Record As Form (not Report)

Jul 17, 2014

I need to find a way to print the currently selected record (by clicking a button in the form) as a form. I know printing is almost always done in records, but they use the forms by hand before entering them into the computer database.

One tough part of this is that this printing function needs to be sustainable through revisions of the form, as we will be constantly updating it.

Is there a way to print the form with only the current record shown without creating a second form or report?

View 2 Replies View Related

Forms :: Unable To Print A Report From A Record In Form

Oct 14, 2013

Why I cannot print a report using a single record in a form using Access 2007.

I have added the button, I am using the following code:

Private Sub cmdPrintRecord_Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "Receipt"
strCriteria = "[ID]='" & Me![ID] & "'"
DoCmd.OpenReport strReportName, acViewPreview, , strCriteria
End Sub

However when I click the button nothing happens. I have attached the database ...

I am using the Contacts Entry form, and when I am on a record that someone has paid I want to be able to print from the Receipt report that has a simple formed up letter.

View 8 Replies View Related

Forms :: Print Current Record On Form To Report?

Mar 21, 2013

I have a DB in Access 2007 which I'm having trouble with. I have a form, "Sub_Det_Frm", on which I would like to place a button to print the current record, (Primary Key is an autonumber "Employee Number") to a report "Sub_DetForm_Rpt".

I've used the instructions from, oops I can't show you the link! It's h(double t)p(colon)//allenbrowne(dot)com/casu-15(dot)html but I'm getting this error:

The expression On Click you entered as the property setting produced the following error: A problem occurred while Employee Details was communicating with the OLE server or ActiveX Control.

This error occurs when an event has failed to run because Microsoft Office Access cannot evaluate the location of the logic for the event. For example, if the OnOpen property of a form is set to =[Field], this error occurs because Access expects a macro or event name to run when the event is fired.

View 14 Replies View Related

Print Dialogue Box? Chosing Printer

Sep 14, 2005

Hello,

Is it possible to get Access to open the print dialogue box instead of printing direct to the default printer when using the print command?

Thanks

View 1 Replies View Related

Print Dialogue Box? Chosing Printer

Sep 14, 2005

Hello,

Is it possible to get Access to open the print dialogue box instead of printing direct to the default printer when using the print command from a button?

Thanks

View 3 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

Modules & VBA :: Determine Which Printer Was Selected From The Print Dialog

Feb 10, 2015

This for an app being used in Access 2003. I'm trying to (sort of) automate naming a PDF report. After the user selects a printer from the print dialog, if the printer name is like "*PDF*" then I want to put the PDF file name in the clipboard so it can be quickly pasted in the file name of the PDF printer's save dialog.

Something like this:

Code:
Dim strSelectedPrinter as string
DoCmd.OpenReport "rpt1", acViewPreview
DoCmd.RunCommand acCmdPrint

[Code]....

but that returns the name of the default printer, not the selected printer.

View 6 Replies View Related

Print Current Record - Open Printer Dialog Box

May 19, 2014

I want to put a print button on my data entry form that prints the current record in a report that is laid out all nice and pretty. I found this code that works, but it goes straight to the printer - it does not bring up the printer dialog so you can select a printer.

Code:
Private Sub RecordPrint_Click()
Dim strWhere As String
If Me.Dirty Then
Me.Dirty = False
End If

[Code] ....

How do I get it to bring up the printer dialog?

View 7 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

Tables :: Find Record Button Added To A Form To Adjust Search Function

Apr 6, 2015

Is it possible on the Find Record button added to a form to adjust the search function so it defaults to a specific box on the form? I have a form for tracking employee's and on my Find Record button I would like it to default to the Last name instead of the Record number.

View 3 Replies View Related

Create Command Button On Form To Send Email

Oct 26, 2004

I have created a form and housed in the form is a combo box that pulls info from managers I work with. I want to create a command button that I can click to send them an email. I have their information tabled and then have also converted that table into a form. I have their email address I just need to know how to properly code the command. I have no visual basic experience. I have had classes where I've coded in C++ and HTML but very limited.

Thanks

View 6 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

Forms :: Embedded Within A Loop To Send Various Filters Of Report To Different Recipients

Aug 15, 2013

In a form I have a button which creates (in preview) an outlook message with a pdf report. It opens and displays just as I want it to, but if I chose to save that message in outlook and either send or cancel (i.e. allowing user to save to drafts and send later) then MS Access crashes.To ensure this wasn't to do with any compile / corruption within my full application I mirrored the process in a very simple 1 table / 1 form / 1 report db and still the same - access crashes after saving the outlook message and either sending the message or cancelling out the message.

Form code is as follows;Private Sub Command0_Click()
On Error Resume Next
DoCmd.SendObject acSendReport, "Table1", acFormatPDF, "someemaddress", , , , "REQUEST FOR INFORMATION"
DoEvents
On Error GoTo 0
End Sub

In my main application this process is embedded within a loop to send various filters of the report to different recipients, which works fine if 'save' is not used within Outlook..

View 1 Replies View Related

Forms :: New Fields Added To Table / Won't Look Up On Form

Sep 8, 2014

I have this table that I built a form from . I added some fields to the table, most of which are look up. I added those fields to the form.When I try to test the form those lookups show nothing.I used the lookup wizzard.I removed those fields and added new ones (same problem).I compared them to the ones that are working - they are identical.I changed the control source to one that is working - didn't work.

View 1 Replies View Related







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