Results 1 to 5 of 5
  1. #1
    maximus007 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    2

    Exclamation How find Duplicate entries across 2 Columns in Access and line them up?

    Hi everybody!

    I'm new to this forum.

    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.

    Please help me out with this, I have been searching for a solution for days without any success. 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.

    Thank you very much!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    You want to show only one record but not delete the duplicate? You want to show all the fields or just these two? If the other fields are not duplicate data, how do we know which one to show?
    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
    losstww is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2012
    Posts
    5
    One method would be to reiterate through a recordset comparing column 1 against column 2 and then clearing column 2 of the duplicate data. This method assumes that the duplicate data is in the same row, just different column

    Dim db As DAO.Database
    Dim rst As DAO.Recordset

    Set db = CurrentDb

    Set rst = db.Openrecordset("tableName or Query")

    with rst
    Do While Not rst.EOF
    .Edit
    If rst!Column1 = rst!Column2 Then
    rst!Column2 = ""
    End If
    .Update
    rst.MoveNext
    Loop

  4. #4
    maximus007 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2012
    Posts
    2
    Thank you for your above replies!

    The duplicates are in same columns, but different rows.


    Want to check for duplicates in 2 columns, but display all columns only with duplicate results(actually the duplicates aren't a problem but exactly what I need to see, since I'm putting together 2 different groups of data that contain similar records, if there is an easier way to put them on the same line I would appreciate your comments),
    The first column to be compared has duplicates, the second one doesn't.

    Please let me know if I can clarify this further.
    Thank you!

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    That confuses me even more. You 'want to check for duplicates in 2 columns' but then state 'first column to be compared has duplicates, the second one doesn't'.

    Re: 'if there is an easier way to put them on the same line', review http://allenbrowne.com/func-concat.html
    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. Replies: 3
    Last Post: 11-15-2012, 09:20 PM
  2. Duplicate Entries
    By brownk in forum Reports
    Replies: 3
    Last Post: 09-11-2012, 12:56 PM
  3. Replies: 8
    Last Post: 01-29-2012, 12:50 PM
  4. validation setting for duplicate entries
    By noweyout in forum Forms
    Replies: 1
    Last Post: 02-18-2011, 06:14 AM
  5. numbering line entries
    By tgavin in forum Access
    Replies: 6
    Last Post: 07-27-2010, 11:53 AM

Tags for this Thread

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