Results 1 to 4 of 4
  1. #1
    Toollady is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2012
    Location
    Virginia
    Posts
    3

    Getting duplicate information in my query

    Click image for larger version. 

Name:	query duplicating result page.jpg 
Views:	5 
Size:	116.4 KB 
ID:	8098Click image for larger version. 

Name:	query duplicating.jpg 
Views:	7 
Size:	101.8 KB 
ID:	8099I have been trying for weeks to get this query to work. Each time I get duplicating info. I have attached both the query and the results

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You are not linking on key fields. Invoice record should have the JobID, not PropertyID.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    First question is - what is the information you are trying to show in the query? From what you show in the diagram it is not clear.

    Your tblInvoiceLineItems is not structured correctly - each invoice has many line items, and that table does not have a field for the line number. Add the line number field, and make it part of the key.

    Your query I think is missing a table - tblInvoice, if that is what you want to show. The relationship would be between NewOrders and tblInvoice, using InvoiceNumber, and not PropertyNumber as June7 pointed out.

    HTH

    John

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Actually, PK in InvoiceLineItems is not critical, nor is a line number for each item of the invoice (can be generated on report), but neither could hurt.

    Can get by without the Invoices table but means having to repeat invoice info such as JobID and InvoiceDate in every line item record. If you do have an Invoices table then it should have JobNumber. Include all 3 tables in the query. Regardless, PropertyID does not belong in LineItems.

    Is there a Customers table? Should CustomerID be in NewJobOrders?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Change information in a query
    By calobo in forum Queries
    Replies: 3
    Last Post: 03-01-2012, 10:32 AM
  2. Display Query Information on a form
    By srmezick in forum Forms
    Replies: 2
    Last Post: 12-15-2011, 09:24 AM
  3. Open form based on query information
    By MFS in forum Programming
    Replies: 3
    Last Post: 06-11-2011, 12:44 PM
  4. Autofill Duplicate Information
    By JohnnyK15 in forum Forms
    Replies: 2
    Last Post: 06-15-2010, 10:53 AM

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