Modules & VBA :: Duplicate Line When Printing Report

Sep 5, 2014

My issue is when there are 4 records (store numbers) for any "row" on the load diagram, the last store's information is duplicated when the report is printed. It only appears once in the table, it only appears once in the query, but when the report prints it prints two lines. It also does not include the duplicate line in the totals at the bottom of the report. This leads me to believe that the issue is in my PrintLines function which is in the modPrintLoadDiagram but I am only a beginner when writing code and have not been able to figure it out on my own.

I am attaching a version of the original database. Please open rptLoadDiagram in Print Preview and look at row 3 on the right side. Store 5449 is showing up twice but should only be on there one time.

This is the only issue holding up my roll out of the database.

View Replies


ADVERTISEMENT

Duplicate Report Printing

Jul 11, 2006

Hi I am new to the forum. :)

I am creating an access database that holds customer information for a friend of mine. I am struggleing to think of ways to make Access do several tasks.

I have created several forms that display when reletive buttons are clicked and some run automatically using queries, one of which runs a query that displays any upcoming service inervals that are within thirty days of the current date, and allows the user to print a report that is designed to be a service notice for the relevant Customer/s which contains the customers address, phone numbers and service due date with a small pre-made text insert that advises the Customer about the upcoming service recommedation. The Form also provides the ability to print address labels for the same customers, making it quick and easy to send them out by post. The problem that I am having is that I would like the customers information that has already been printed to be removed or greyed out in someway so that the query does'nt print out duplicates but also have the ability to allow user control to reprint any result that may for any reason need reprinting.

Thanks for any help
Christopher

View 2 Replies View Related

Modules & VBA :: Read CSV Transaction File Line By Line And Add Correct Transactions To Access Table

Nov 29, 2014

I have a module which reads a CSV transaction file line by line and adds the correct transactions to an access table and places the wrong ones in a logfile.Now some transactions are rejected twice there is even one rejected six times. Whereas one wrong transaction is processed only once. I am certainly overlooking something obvious in the logic but what. Here is the relevant code.

Code:

Function ImportCSVForConfederation(inputCSV, ORG)
Dim TNO As Integer, TACT As Integer, TABLE As String, TLINE As String, I As Integer, J As Integer, K As Integer
Dim FLD1 As String, FLD2 As String, FLD3 As String, FLD4 As String, LogFile As String, LogPath As String
Dim Lim As String, ITNO As Integer

[code]....

View 8 Replies View Related

Modules & VBA :: How To Import Text File Line By Line

Nov 18, 2014

I am having a little difficulty with my importing in Access. Every time I import my text file, the lines will be jumbled. I have been reading up and I found this recordset code that seems to be what I need:

Code:
Dim strLine As String
Dim intLineNum As Integer
Dim MyDB As DAO.Database
Dim rst As DAO.Recordset
Open "C:TestTest.txt" For Input As #1
Set MyDB = CurrentDb
Set rst = MyDB.OpenRecordset("tblResults", dbOpenDynaset)
CurrentDb.Execute "DELETE * FROM tblResults", dbFailOnError 'Clear tblResults

[code]....

Basically, this code will extract data from the text file as long as it fulfills the Mid$ criteria. Here's where my problem comes. Each line in my text file is of different lengths and I have to capture the entire line.

I think using the Left$ function would work, but I don't know how to determine the character count such that the entire line of text would be inserted into the table.

Another difference between what I need and the code above is that, I am required to store each line into each row of my table, meaning

Line 1 is placed in Row 1 Column 1
Line 2 is placed in Row 2 Column 1
Line 3 is placed in Row 3 Column 1
.
.
.
Line X is placed in Row X Column 1.

View 14 Replies View Related

Modules & VBA :: Printing Code Slowing Down Printing Reports?

Feb 25, 2014

I was having trouble just setting each report with a particular print method - for some reason they just kept forgetting their individual settings and resorting to default on the machine.

This meant reports were printing on the wrong paper, or the wrong size paper, the wrong orientation and some times refusing to print if it couldn't find the paper (which is useful in runtime as it doesn't display error messages)

So I used Reports(rpt).printer properties (I forgot where I found this) to hard code the printer properties into each print command... this meant I had to use another function to insert the variables.

So all I had to do was say:

Code:
PrintMe("Invoice","InvoiceID",iID)

and a report would print to exactly how I wanted... but it's just too slow!

See attached for full code, I have a niggling feeling it may be the function: PrinterOK, to make sure the printer exists or not.

Code:
Function PrinterOK(sPrinterName As String) As Boolean
Dim MyPrinter As Printer
PrinterOK = False
For Each MyPrinter In Printers
If MyPrinter.DeviceName = sPrinterName Then
PrinterOK = True
Exit Function
End If
Next
End Function

I know it's the printing code, because if I stop the printing and just preview then it shows up almost instantly.

View 1 Replies View Related

How To Find Duplicate Entries Across 2 Columns In Access And Line Them Up

Nov 16, 2012

There is an issue that I cannot resolve in MS Access:

I have a large files with multiple columns that has 2 columns that randomly contain duplicated data.

I would like to filter out the duplicated entries in these 2 columns without spoiling the data integrity - and so the duplicates appear on the same row.

I think what I want it pretty much like conditional formatting in excel, but unfortunately the file size is really large to be filtered in excel.

View 4 Replies View Related

Inserting A Line Break On A Report

Sep 7, 2006

I have text in a number of fields that I want to insert into a text box on a report. The size of the text box is large enough to accommodate, but I want each line to have a linefeed (or carriage return) before it.

The report is based on a query. I created a field in the query that consists of something like:...txtText1 & CHR (10) & txtText2 & CHR (10) txtText3 AS MYTEXT.

What I did was to set the control source on the text box to MYTEXT, hoping that there would be nice linefeeds in between the fields. Unfortunately, all I got were some funny-looking boxes.

What's interesting is that you CAN insert a linefeed into a memo field and that linefeed will display properly. I just don't know how to force one in there to separate lines of text.

Any ideas?

SHADOW

View 10 Replies View Related

Custom Line Number On Report ?

Oct 6, 2006

I try to explain my problem.
There is a report have 50 records.
I print the report first time and Set the number by Data>running sum method. This start from 1 to n...

I require a Form Where i enter to initial number example 22 and say preview report.
The report Set the line number of Details Section Like
22
23
24 etc...



How can i do this. Please help

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

Colour Printing From Report

Jan 17, 2007

Hi all, i'm having a rather annoying problem. When I view my report I have 2 sets of conditional formatting that run, one that changes the back colours of certain fileds when the criteria is meet, and the second, the text colour of certain fields, both of which work fine when previewing the report. However, when I print the report, any of the back colour in the preview does not print out but text colour does. If I print from another office programme i.e. Word, block colour is printed fine its just seems to not work in my access.

Please note that if the same report is printed from another computer, it prints fine.

Please does anyone have any idea on why this is happening and how to sort it. Thanks in advance for any ideas and help.

View 1 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 One Forms Report

Nov 6, 2006

Hi, Ive read all I can on forums and web and am still unable to print the current forms report using a command buttons on click. This is the code i have been playing with:

Dim strDocName As String
Dim strWhere As String
strDocName = "Home_Oxygen_Report"
1. 'strWhere = "[general_info.HospitalNumber]= Me!Home_Oxygen_Form!general_info.HospitalNumber"
2. strWhere = "[general_info.HospitalNumber]= "" & Me![general_info.HospitalNumber] & """
3. 'strWhere "[general_info.HospitalNumber]='" & Me![general_info.HospitalNumber] & "'"
DoCmd.OpenReport strDocName, acViewPreview, , strWhere
Number 3 gives the closest result but it prompts me to enter the primary key when i hit the command button but i need it to do this automatically. The primary key is a text box not number. Note that the primary key is HospitalNumeber of Table general_info (form and reports record source is query of many tables).

any help would be muchly appreciated!!

Tania

View 3 Replies View Related

NOT Printing Image In Report

Dec 3, 2004

MS Access 2003

I inserted an image (jpg) in a report, it appears in PrintPreview, but not when I print it on my printer.
Please help me. I do not if the problem is with my printer or I'm doing something wrong when inserting the image.

update: It seems to work when printing from Print icon, but does not work when printing from File/Print menu. Is this a known bug?

View 5 Replies View Related

Help On Printing Report From Server

May 14, 2005

Need how to help on printing reports in Access

Problem: I have a databse that is on a network at the office. My users are out in the field using mobile data computers linked to the network using verizon air cards (56.6 kbps modem). Whenever they want to print a report, since the front ends of the DB are on their computers and the back end is on the server, the mobile computer has to send the actual report from the computer over the air card to the server for printing. Each page takes 5-7 minutes before it prints at the office.

Question: Since the data resides in a table on the back end on the server, Is there a way to have the reports reside on the server as well and have the Mobile computers simply send a command to print the report from there so it's not having to send all that information over the incredbly slow air card? Or am I just going about this the wrong way altogether?

I'm not totally up to speed yet on all this computer lingo so please use little words (LOL).

View 5 Replies View Related

Reports :: Sub-report Not Printing

Jan 13, 2015

I have a report with one sub-report. It previews correctly and prints correctly from my ACCDB. However, when I create an ACCDE, the sub-report previews correctly and then does not print. I have tried the following and none work: In the main report, deleted the links and changed the subreports record source.

Changed layout for print to no
Changed filter on empty matches to no

Moved everything from detail to page header.When I put code in the subreport to set a flag when loaded and queried that flag in the main report, the subreport never admitted to being loaded when run from the ACCDE (again works fine from the ACCDB).

View 4 Replies View Related

Reports :: Printing Into Pdf From A Report

Mar 1, 2013

I'd like to print out a report so that each record should be printed into an individual pdf file. When printing manually, record by record, I use an app called cuteprinter for converting reports into pdf. But that one needs saving path for each individual pdf file. What could I do if I'd like to make a series of record printing? Would there be a way of automatic generating path and file name for each record's print?

View 1 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 To PDF In Access

Oct 22, 2015

I have an Access Database installed on a server that is accessed remotely by numerous users. I have a button to print out a specific report. The problem is that in order for a user to print the report their print driver must be loaded on the server. Due to the number of users, and the numerous types of printers available, this is impractical. The current code on the button is currently:

Private Sub Command PrintReport Click()
Dim strWhere As String
strWhere ="[Property Number] = " & Me.[Property Number]
DoCmd.OpenReport "RESERVE REQUIREMENT REPORT", acViewNormal, ,strWhere
End Sub

I would like to know if there is some code that would send the report to PDF, so that any remote user could then print the report from PDF.

View 2 Replies View Related

Command Line To Display Access Report

Sep 19, 2004

I am looking for help to to generate a command line to automatically run a report within a windows program I am using. The program I use has command line fields to automatically open the access report when I complete my program session. I have tested the command line with a standard C:.... .exe to open Word, Access, etc.

I have tried using the create shortcut and snapshot methods without success and wondering if a macro is needed (havent a clue).

Hoping someone can help!

thanks... Keith

View 2 Replies View Related

Reports :: Report Items Filling A Line Then Next

Oct 17, 2013

using Access 2000.I have a table with fields (image, info1, info2, info3).I want to produce a report where 15 records are displayed in a table like manner. each table cell contain the whole record and the table is 5 rows by 3 columns.

View 4 Replies View Related

Reports :: Row (Line Item) Number On Report

Mar 26, 2014

I want to have line item numbers on report look like this:

Number....Order Number
1............9533-1425-20
2............5866-3411-14
3............2332-2355-14
3............2332-2355-14 ->repeating item
4............4399-5208-12
5............7392-2305-62
5............7392-2305-62 ->repeating item
6............2332-2355-14

Each new row of record needs to have their own line item number starting from 1 with criteria if order number is the same then carryover line item number on that record. I know how to get line item starting from 1 to last by assigning unbound control field with entry "=1".

View 14 Replies View Related

Printing Only One (current) Record In A Report

Jul 19, 2007

Hi Everyone,

I'm probably going about this the wrong way all together, but what I'm trying to do is print a single record from a form in a report.
Basically after the client fills in the form they can print their "results report" using the click box (command button) in the bottom corner of the form. When the client clicks on the button it prints all the records ("result reports") of all the clients...no good of course.
Here's the code for the button:

Private Sub PrintSingleChamber_Click()
On Error GoTo Err_PrintSingleChamber_Click

Dim stDocName As String

stDocName = "SingleChamberPrintOut"
DoCmd.OpenReport stDocName, acNormal

Exit_PrintSingleChamber_Click:
Exit Sub

Err_PrintSingleChamber_Click:
MsgBox Err.Description
Resume Exit_PrintSingleChamber_Click

End Sub

Can someone point me in the right direction? :confused:
Thanks again,

Mark

View 1 Replies View Related

Printing Report Re-runs All Queries

Jan 31, 2008

I have a report with several subreports which run agains a very large table. If I decide to print the report after examining it, all of the underlying queries must run again. Is there any way around this to avoid this delay, other than exporting as rtf or snp?

Thanks,

Randy

View 1 Replies View Related

Printing Date Range On Report

Jan 23, 2006

I have a report that I want to pint the beginning date and ending date range that the report was based off of.
I have a query that prompts for begining date and ending date

I want the print to look like this.

Current Report Date : 01/01/06 to 01/30/06

Any Ideas

Thanks
Dean C
Giles Chemical

View 14 Replies View Related

Help With Printing A Report Based Off A Query.

Jun 13, 2006

Hi all..

I have a drop down list on a form that prints a report based off of the selection in the cbo box...

(I have already changed the query and relationship for the lookup and maintable)

Here is the code that works fine,(this is on a command button)

Private Sub cmdViewStreet_Click()
stDocName = "rptStreetName"
On Error Resume Next
DoCmd.OpenReport "rptStreetName", acViewPreview, acEdit
Me.cboStreetName = Null
End Sub


What I am doing now.. is this: the look up table that had the street names but did not have an autonumber or primary key. I added in a autonumber and primary key. I can get the cboStreetName to list the street names and not the autonumber.. and I can get the main table to store the autonumber not the street name (this is what I want).. but now I can't get it to view what is in the cboStreetName... When I hit the view button it does nothing... Any suggestions?? If you need more info please let me know...

I tried something like this to:

Private Sub cmdViewStreet_Click()
On Error GoTo Err_cmdViewStreet_Click
Dim stDocName As String
stDocName = "rptStreetName"
DoCmd.OpenReport "rptStreetName", acPreview, , "[StreetName]=" & Me.cboStreetName.Column(0)
Exit_cmdViewStreet_Click:
Me.cboStreetname = Null
Exit Sub

Err_cmdViewTitle_Click:
MsgBox Err.Description
Resume Exit_cmdViewTitle_Click

End Sub


R~

View 1 Replies View Related







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