Results 1 to 13 of 13
  1. #1
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659

    Report Generates Duplicate Lines


    I have a report that is powered by a query. When I view the query, everything looks as I would hope. When I try to make a report that consumes this query, I get duplicate lines. I am using Microsoft Office Access 2003 (11.8321.8341) SP3.

    How do fix this?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Shouldn't happen if the query is the source. You don't have fields in both a group header and the detail section do you?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    I used the wizard to make the report for the grouping. It does not appear to have the flaw you mentioned. I am currently trying to step through stop statements on the formatting to figure out when it happens.

    The duplicates start at the first group and continue into the rest. I have tried removing the group headers, this didn't help as the amount of data returned didnt seem to change.
    Last edited by Perceptus; 11-15-2012 at 02:06 PM. Reason: finished stepping

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    `Can you post the db here, or at least the code that's running?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    what parts?
    Code:
    Private Sub cmdWRProdCustomer_Click()
    On Error GoTo Err_cmdWRProdCustomer_Click
    
    
        Dim stDocName As String
    
    
        stDocName = "qryMetricsWRProduction_Company"
        DoCmd.OpenReport stDocName, acPreview
    
    
    Exit_cmdWRProdCustomer_Click:
        Exit Sub
    
    
    Err_cmdWRProdCustomer_Click:
        MsgBox Err.Description
        Resume Exit_cmdWRProdCustomer_Click
        
    End Sub

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    It sounded like there was code running within the report?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Nah, I was only using debug.print in the events for detail format and header format. the problem seems to occur before those events.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Can you post the db here, or a representative sample?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    The query that is used is

    Code:
    SELECT tblCustomer.CompanyName, tblFoundryReceiptLI.LongDescription, 
    tblFoundryReceiptLI.Qty, tblSalesOrders.SalesOrderID, tblSalesOrders.OrderDate, tblSalesOrders.DatePromised, tblFoundryReceiptLI.DatePartPoured, tblOrderOfMaterials.Material, tblSalesOrders.ShipDate, tblFoundryReceiptLI.autom_mold_date, tblFoundryReceiptLI.autom_pour_date, tblFoundryReceiptLI.autom_clean_date, tblFoundryReceiptLI.autom_wr_date, tblFoundryReceiptLI.autom_ship_date, tblFoundryReceiptLI.autom_hs_date, CInt(CDate([tblSalesOrders].[DatePromised])-Now()) AS days_until_due, tblSalesOrders.DatePromised, tblFoundryReceiptLI.isNotes, tblFoundryReceiptLI.frIDFROM (((tblFoundryReceiptLI INNER JOIN (tblSalesOrders INNER JOIN tblSalesOrdersInventoryLIneItems ON tblSalesOrders.SalesOrderID = tblSalesOrdersInventoryLIneItems.SalesOrderID) ON tblFoundryReceiptLI.SalesOrderID = tblSalesOrders.SalesOrderID) INNER JOIN tblCustomer ON tblSalesOrders.CustomerID = tblCustomer.CustomerID) INNER JOIN tblPartMaster ON tblFoundryReceiptLI.PartNumber = tblPartMaster.PartNumber) INNER JOIN tblOrderOfMaterials ON tblPartMaster.MaterialCode = tblOrderOfMaterials.MaterialCode
    WHERE (((tblFoundryReceiptLI.frID)="1" Or (tblFoundryReceiptLI.frID)="2"));
    not really sure if you want test data for each table?

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    But you said the query returned records correctly, right? I was hoping for a db that recreated the problem, so we could figure out where the duplication is coming from.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Its a workgroup database, I can't give out the login info.

    Interesting, I changed the query to a Make table query using Access and let it do its thing. The resulting table had all the duplicates that I am seeing on the report. Change the query back to a select and I get all the rows without the duplicates.
    Last edited by Perceptus; 11-16-2012 at 02:40 PM. Reason: tried other options

  12. #12
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2003
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    I found my answer here.

    http://www.ehow.com/how_8229282_supp...ss-report.html

    I am still mystified as to why I would need to do this. Changing this option doesn't affect the data when i view the query or bind the query to a form. So odd.

    I would mark this solved. But i dont know how.
    Last edited by Perceptus; 11-20-2012 at 03:43 PM. Reason: I would mark this solved. But i dont know how.

  13. #13
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    That would imply the query was returning duplicates, but I thought it wasn't. In any case, you can mark the thread solved in Thread Tools at the top of the thread.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 01-27-2012, 12:52 AM
  2. Eliminating null lines in report
    By brobb56 in forum Forms
    Replies: 2
    Last Post: 09-26-2011, 11:05 AM
  3. Eliminating null lines in report
    By brobb56 in forum Reports
    Replies: 1
    Last Post: 09-26-2011, 11:01 AM
  4. Multiple lines per record: Report?
    By cjbuechler in forum Queries
    Replies: 7
    Last Post: 07-30-2009, 08:32 AM
  5. Duplicating lines in an invoice report
    By GordonEdinburgh in forum Forms
    Replies: 0
    Last Post: 04-21-2007, 12:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums