Results 1 to 2 of 2
  1. #1
    Shmueldabomb441 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2019
    Posts
    2

    Deleting any rows containing values in another table's rows


    I have a database which stores records of audio lectures available on a website. Each audio lecture has a representation in my Access file and an accompanying lecture id in the table titled AI_lectures. One column in AI_lectures has the lecture's title, and another has its unique id. I found that there are some duplicate lectures from a particular speaker on the website, except the duplicates have ".MP3" at the end of it. Obviously, the ".MP3" lectures have different unique id's than their non ".MP3" counterparts. I have manipulated the range of lectures in an Excel spreadsheet and found the id's of the duplicates. Say i were to copy/paste the range of duplicates into another table called AI_duplicates. I would like to have a way of deleting any entry in AI_lectures which has an id which is also found in AI_duplicates. Anyone have any ideas? a macro maybe?

    Thanks a million!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    One way is to create a list of the iD's you want to delete.
    then make a delete query similar to a FIND DUPLICATES query.
    use the query wizard and make a find duplicates query,
    Edit query,
    notice the : IN (select ID from table)

    Do the same for the delete query,
    the ID to delete will use the sub query:
    delete * from table1 where table1.ID (in (select table2.id from table2))

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

Similar Threads

  1. Replies: 5
    Last Post: 03-11-2019, 02:35 PM
  2. Replies: 7
    Last Post: 05-25-2018, 05:56 PM
  3. Replies: 3
    Last Post: 02-16-2016, 03:10 PM
  4. Replies: 3
    Last Post: 10-06-2013, 01:54 PM
  5. Replies: 1
    Last Post: 11-20-2012, 03:31 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