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 Replies


ADVERTISEMENT

Print Multiple Copies Of A Report Using Macro

Jan 7, 2015

In Access 2007 is it possible to alter a macro so I can print 2 copies of a report. I have created a simple macro which opens up a report based on a value in a data entry form. I want to automatically print 2 copies of the report. Is this possible....

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

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

Print 2 Copies

Oct 15, 2007

I have a form in Access with a command button that prints a receipt (which is actually created as a report). Anyway, I want 2 copies of this receipt to print when the print receipt button is clicked. Please take a look at my code and tell me what I would need to be able to accomplish this. Thanks.

rivate Sub PrintRec_Click()
On Error GoTo Err_PrintRec_Click

Dim rstTrans As New ADODB.Recordset
Dim fld As ADODB.Field
Dim strField As String
Dim curCount As Currency

rstTrans.Open "dbo_tbl_Transactions", CurrentProject.Connection, adOpenKeyset, adLockOptimistic

If IsNull(Me.TempTransNumID.value) Then
'this is new record
rstTrans.AddNew
Else
'to stay on the record that was just inserted for editing
rstTrans.Find ("TransNumID=" + Str$(Me.TempTransNumID))
End If

rstTrans!TransDate = Me.TransDate
rstTrans!CustomerName = Me.CustomerName
rstTrans!VehType = Me.VehType
rstTrans!TktType = Me.TktType
rstTrans!Auth_By = Me.AuthBy
rstTrans!Quantity = Me.Quantity
rstTrans!SHtkt1 = Me.SHtkt1
rstTrans!SHtkt2 = Me.SHtkt2
rstTrans!HRtkt1 = Me.HRtkt1
rstTrans!HRtkt2 = Me.HRtkt2
rstTrans!TransPayAmt = Me.TransPayAmt
rstTrans!PaymentType = Me.txtPaymentType
rstTrans!PaymentMethod = Me.cboPaymentMethod
rstTrans!CheckNum = Me.CheckNum
rstTrans!TransReceiptMemo = Me.TransReceiptMemo
rstTrans!TransEntryTime = Now()
rstTrans!TransEntryUserID = appUser

If Me.cboPaymentMethod = "Check" And IsNull(CheckNum) Then 'Check number not entered
MsgBox "You must enter a check no.", vbCritical, "Check Number Verification"
CheckNum.SetFocus
Exit Sub
End If

rstTrans.Update
'this was a new record so update the form value of TransNumID for edit
If IsNull(rstTrans!TransNumID.value) <> True Then
Me.TempTransNumID = rstTrans!TransNumID.value
End If

whereClause = "NewQryShuttleHandiRideReceipt.TransNumID" & " = " & rstTrans!TransNumID

//////here is where I'm printing the receipt
DoCmd.OpenReport "RptShuttle HandiRide Receipt", acViewNormal, , whereClause

rstTrans.Close

Set rstTrans = Nothing
Me.cmdAddRec.Enabled = True

Exit_PrintRec_Click:
MsgBox "Record Successfully Saved! Printing Receipt."
Exit Sub

Err_PrintRec_Click:
MsgBox Err.Description
Resume Exit_PrintRec_Click

End Sub

View 2 Replies View Related

Print 3 Copies Of Invoice With Different Remark

Jul 8, 2007

I want to print 3 copies of a report named Invoice with different remark i.e. Customer Copy, Office Copy, Auditor Copy. I want to print all 3 copies with a single print command.

Can any one help me.
Sample database is in attachmant.

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

Reports :: Workorder - Print Three Copies With Each Copy Having Different Text In Footer

Jan 23, 2014

I have an old access database (written with 2003 but running under 2010) that creates workorders and I need to change a couple of the reports to print three copies with each copy having different text in the footer. I'm converting the reports from a old DOT Metrix special form printer to a laser printer. I have already modified the reports as far as the titleing and cosmetics are concerned and they print and look great on the laser printer. I have also added a TxT box that I want to contain the information on the report.

The reports are generated in a couple of different ways off different screens in the system off buttons, but I figured if I can get one of them to work I can replicate it to the others.

I have gone through the reports forum and have found a couple of solutions but can't get them to work. This is what I have found:

On the on button to print a range of workorders (it drives a query that asks for a starting workorder number and a ending workorder number) click from the from the switchboard:

DoCmd.OpenReport "rptBulkWorkOrdersbyWorkOrderNumberRange", , , , , "1"
DoCmd.OpenReport "rptBulkWorkOrdersbyWorkOrderNumberRange", , , , , "2"
DoCmd.OpenReport "rptBulkWorkOrdersbyWorkOrderNumberRange", , , , , "3"

Then I have this code but I'm not sure where it goes. On the report in the "on open" expression? not sure..

Select Case Me.OpenArgs
Case "1"
txtBox62 = "Shop Copy"
txtFld1 = [qryField1]

[Code] .....

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

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

Forms :: Command Button Prints Two Separate Copies?

Mar 20, 2013

I am working with an already intact database along with a form. One of the buttions in the form, when pressed, prints two copies of a P.O. One copy says original on the bottom and the other says PX Copy and my boss wants the PX Copy to stop printing. How do I get it to stop?

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

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

General :: All Objects Toolbar Opens When Hit Print Button On Form

Jan 30, 2013

Using Access 2010.I purposely disabled the Access Objects when opening my database for added security. This works.

The problem I'm having is when I use the print button (access macro) on one of my forms, as soon as i click the button, the "all access objects" window opens on the left side navigation. This window shows all of my tables, forms, queires..etc.Is there a setting that will permanately stop this from opening?

View 1 Replies View Related

Save Record And Create Print Preview With Same Button On A Form?

Apr 8, 2014

In Access I have created a button to print a preview prior to printing document it is entitle "NoVeteranMain" which works fine. Except I want it to save my document prior to printing preview how would I do it. If not after I edit it I have to re-save it prior to hitting button which generates print preview.

This is code that is generate upon click

Private Sub NoVet_Click()
DoCmd.OpenReport "NoVeteranMain", acViewPreview, , "ClientID = " & Me.ClientID
End Sub

View 5 Replies View Related

Print Report From Form

Oct 2, 2005

I have a form which records the progress of a complaint investigation. There are 3 reports I would like to run from this form using command buttons. They are report_long (shows all activity) report_short (summary) and logsheet.
The primary key is complt#.
How do I ensure that the complaint being printed is the complt# I have on the form?

View 6 Replies View Related

Print Report From Form

Mar 10, 2006

Please bear with my ramblings, but I’m not sure what you may find relevant.

I am currently doing work for a service company where the employees are required to wear the company’s uniform. When someone joins the company they are required to purchase their own uniform. After a year, the company buys the replacement uniform. Each year on the anniversary date, the employee is given their annual evaluation. At that time they are given a requisition to go to the uniform supplier for new uniform articles.

Each item in the uniform has a life span. For example, shirts and pants are replaced each year, winter coats and spring/fall coats are replaced every three years, caps every two years etc.

I have a form which lists the item no., description and cost of each item and when they are due to be replaced. For example
Winter coat last replaced on 2003/11/10, replacement date is calculated to 2006/11/10
When this employee has his evaluation this November, he will be entitled to a new winter coat. The calculations are done by clicking an option button beside the item on the form. Clicking replaces the issue date with Date() and adds three years to the issue date using DateAdd for a new replacement date. Clicking the button also indicates that the item is to be replaced.

NOW, I have all this working.

What I would like to do is find some way of printing the requisition from this form before closing it. Something along the lines of:

If Option1 is yes
Print this item on the requisition
Endif

And do this on every item on the form, if it’s yes, print it on the requisition, if its no ignore it.

The option buttons are not part of the underlying tables or query only part of the form.

If I’m doing this backwards, please let me know. I’m well ahead of my deadline.

View 1 Replies View Related

Form/Report Print

Mar 22, 2006

I have a form and the information on the form is displayed in a report so the user can print it out.

I have placed a command button on the form so that when you press the button you can print the report.

I was wondering if there was a way how i could just get it to print of the specific page i was on at the time.

Thanks for any help

View 1 Replies View Related

Reports :: Query Based On Linked Tables - Report Produces Multiple Copies Of The Same Record

Jul 22, 2013

My report produces multiple copies of the same record. I know why, but don't know how to fix it.

EmployeeTable.

With a one to many relationship with TrainingTable (via employee PK as FK in trainingtable).

Training table has a one to many relationship with a table called Range.

Report is based on a query that picks up the Employee/Training/Range (range just describes the training unit).

However, If I have more than one range expressed organized a training unit, the report spits out several copies of the Employee record to display all the ranges.

View 2 Replies View Related

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

Getting Data On Form To Print On Report

Dec 12, 2006

Hello,

I have a time and billing database that contains a form where the user enters a beginning date and an end date and then must enter an invoice number. All this information will appear in the header of a report. The invoice number will always be different. How can I get the invoice number to print on the report? The beginning and ending date is working just fine, but I can't get the invoice number to print. I think I need to have whatever number is entered to be temporarily stored to a table, but I am not sure at all. I would appreciate any help given.

Thanks.

View 1 Replies View Related

Take Information From A Form, Use To Print Out A Report

Dec 11, 2007

I have a patient information database which uses a filtered form to show records for only one patient at a time. All the records in the database are linked together using one number, the patient's unique identifier.

I have designed a report which draws information from separate tables and generates a complete summary of information. This report depends on having the ID number of the patient to generate the report.

Originally, I had envisioned having a command button on the data entry form, which would then automatically take the ID number from the form, and generate the report. Though good in theory, it never worked out in practice, as I could never figure out how to make it happen.

Is there a way to design a macro or some other thing that would take the ID number from the field on the form, and use it to generate the report? Currently, I have it configured to prompt me for the ID number. When I enter it manually, the report is generated perfectly.

Thank you in advance,

View 2 Replies View Related

Reports :: Print From A Form To A Report?

Jul 21, 2015

I am trying to print from a form to a report. The problem I am running into is I am getting a long report and I have discovered I have basically the same number of pages in my report as I have entries in my subform. If I have one entry in my subform I get a 1 page report. If I have 2 entries in my subform, I get 2 pages in my report and they look exactly the same. What am I doing wrong?

View 2 Replies View Related







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