G Guest Feb 21, 2006 #1 I have a table listing all of the records that I want to delete from another table - how do I go about setting that up?
I have a table listing all of the records that I want to delete from another table - how do I go about setting that up?
L Lynn Trapp Feb 21, 2006 #2 Hi Erika, Try something like this: Delete * From YourTable1 Where YourIDField in (Select IDField2 From YourTable2); -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm Jeff Conrad's Access Junkie List: http://home.bendbroadband.com/conradsystems/accessjunkie.html
Hi Erika, Try something like this: Delete * From YourTable1 Where YourIDField in (Select IDField2 From YourTable2); -- Lynn Trapp MS Access MVP www.ltcomputerdesigns.com Access Security: www.ltcomputerdesigns.com/Security.htm Jeff Conrad's Access Junkie List: http://home.bendbroadband.com/conradsystems/accessjunkie.html
G Guest Feb 21, 2006 #3 Please forgive me for not understanding - when I select that it is going to be a delete query I have the following info to fill in: Field: Table: Delete: Criteria: My 2 tables are called - IMC-Intern Logs and Deleted Accounts - I want all the records in the Deleted Accounts removed from the IMC Intern Logs.
Please forgive me for not understanding - when I select that it is going to be a delete query I have the following info to fill in: Field: Table: Delete: Criteria: My 2 tables are called - IMC-Intern Logs and Deleted Accounts - I want all the records in the Deleted Accounts removed from the IMC Intern Logs.
J John Spencer Feb 23, 2006 #4 Add both tables to your query grid Join them on the field(s) that are the key fields (the matching fields) Field: Your ID Field Table: IMC Intern Logs Delete: Where Criteria: <blank> Click the Run button or select Query: Run from the menu BACK UP your database BEFORE you do this. Just in case it doesn't work as expected.
Add both tables to your query grid Join them on the field(s) that are the key fields (the matching fields) Field: Your ID Field Table: IMC Intern Logs Delete: Where Criteria: <blank> Click the Run button or select Query: Run from the menu BACK UP your database BEFORE you do this. Just in case it doesn't work as expected.
G Guest Feb 23, 2006 #5 Fantastic - thank you for your help. John Spencer said: Add both tables to your query grid Join them on the field(s) that are the key fields (the matching fields) Field: Your ID Field Table: IMC Intern Logs Delete: Where Criteria: <blank> Click the Run button or select Query: Run from the menu BACK UP your database BEFORE you do this. Just in case it doesn't work as expected. Click to expand...
Fantastic - thank you for your help. John Spencer said: Add both tables to your query grid Join them on the field(s) that are the key fields (the matching fields) Field: Your ID Field Table: IMC Intern Logs Delete: Where Criteria: <blank> Click the Run button or select Query: Run from the menu BACK UP your database BEFORE you do this. Just in case it doesn't work as expected. Click to expand...