Results 1 to 13 of 13
  1. #1
    intrepid is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    24

    Duplicate records displayed even though no duplicates in table?

    I've created a simple 'multiple values' form, and it displays duplicate records despite there not being any in the table! How do I display only a single record per name?Click image for larger version. 

Name:	Duplicate example.png 
Views:	22 
Size:	21.3 KB 
ID:	19829

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Is the form RecordSource a query that joins tables?
    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
    intrepid is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    24
    Yes, what I've done is link two tables - Program Information and Contact Information - where the contact information has multiple records for each Program.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Instead of joining tables, probably need to build form/subform arrangement.
    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.

  5. #5
    intrepid is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    24
    That may not work in this context; what I've done is made records clickable on the Program List table to open a form that displays several values from the Program List table along with a Contact Details subform.

    There is no way to have the Program List table stop displaying duplicate values based on 'same' fields displayed in the form?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Not with that query and not if you want the records editable. If you don't want to allow editing, then make the query a GROUP BY or DISTINCT.
    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.

  7. #7
    intrepid is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    24
    Okay, so I've created the Program List display form through a query... when I try to make the records clickable - open another, windowed form, with more information - I get an error. Not sure what I'm doing wrong!

    Basically, all of the fields I want displayed in the form are included in the query design - once the record is clicked on I want a separate form to be displayed that contains information from the table that includes the original information (Program List table) and another table (Contact Details table). The following are the error messages and query design.

    Click image for larger version. 

Name:	query example.png 
Views:	18 
Size:	31.9 KB 
ID:	19865
    Click image for larger version. 

Name:	error message.png 
Views:	18 
Size:	10.6 KB 
ID:	19866
    Click image for larger version. 

Name:	error message 2.png 
Views:	17 
Size:	9.2 KB 
ID:	19867


    I'm really learning a lot from this process, so thank you June7.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Don't understand what you are trying to do with that query. Why are you joining these tables in query? The only field from ContactDetails is ProgramID and the data is already in ProgramDetails.

    I don't use macros, only VBA. I really don't know why that errors. If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  9. #9
    intrepid is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    24
    Sorry for the confusion; basically when you look at the db, the Program List form has all the functionality I need - essentially a search function and the ability to click on records to open a profile form (the Profile Page form). However, duplicates are created for the Program List record entries for some reason (even though no duplicates are in the Program List table). I think it may be because some of the program records have the the same/repeated contact name/information.
    Last edited by June7; 03-02-2015 at 01:32 AM.

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Yes, that would cause 'duplicate'.

    Didn't answer my question. But now I see in the db the query pulls in ContactName field.

    Clean up the duplicates from ContactDetails. Why does Vicky Schreiber have two records?

    If each program can have multiple contacts, then that is what will be reflected when you join these tables. This is to be expected in 1-to-many or many-to-many relationship.

    Is this real data? Should not post databases with real data.
    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.

  11. #11
    intrepid is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    24
    Right, so the issue appears to be that for records with more than one contact, a duplicate record entry is shown on the Program List form... Is there a way to fix this so that only one record entry is displayed in the form, per program record?

  12. #12
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Remove ContactDetails from the query.

    Again, why are you including this table and don't show any data from it on the form?
    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.

  13. #13
    intrepid is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    24
    Quote Originally Posted by June7 View Post
    Remove ContactDetails from the query.

    Again, why are you including this table and don't show any data from it on the form?
    I assumed I needed to provide the relationship between Program ID's in the query in order for the separate form to display correctly - that when you clicked the record entry it would show the appropriate information from a separate table - but I was wrong! I can just use the Where Condition to have the appropriate ID's connect to display the right information!

    Adding DISTINCT to the SQL as explained in this youtube video solved my problem.

    Thanks a bunch for your help!

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

Similar Threads

  1. Replies: 3
    Last Post: 03-22-2014, 04:32 PM
  2. Replies: 1
    Last Post: 12-20-2013, 05:14 PM
  3. check duplicate records within same table
    By cthorn112 in forum Queries
    Replies: 0
    Last Post: 06-19-2012, 12:23 PM
  4. Replies: 4
    Last Post: 06-18-2012, 07:01 AM
  5. Replies: 2
    Last Post: 04-13-2012, 12: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