Results 1 to 3 of 3
  1. #1
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544

    Question Delete Query

    My goal is this.

    Users mark records to be deleted in one table. The records have a primary key field. What I want to do is delete all records in a second table where the users made the selection in the first table. Here is some "pseudo code" if you will.

    Delete * from table2 where table2.ID = table1.ID and table1.Sel = Yes



    When I try to run this code it says "Cannot Delete".

    Code:
    DELETE Table2.*, Table1.Exclude
    FROM Table1 INNER JOIN Table2 ON Table1.PriEntityID = Table2.PriEntityID
    WHERE (((Table1.Exclude)=Yes));
    Any help will be much appreciated.

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    delete distinctrow table1.*
    FROM Table1 INNER JOIN Table2 ON Table1.PriEntityID = Table2.PriEntityID
    WHERE (((Table1.Exclude)=Yes));

  3. #3
    jgelpi16 is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Location
    Charlotte, NC
    Posts
    544
    Thank you!

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

Similar Threads

  1. Replies: 2
    Last Post: 08-24-2010, 03:32 PM
  2. DELETE query
    By dollygg in forum Queries
    Replies: 1
    Last Post: 04-27-2010, 04:12 PM
  3. Running a Delete (Records) Query on Close
    By NoiCe in forum Queries
    Replies: 1
    Last Post: 07-12-2009, 06:17 PM
  4. Delete Query Deleting Too Much
    By TundraMonkey in forum Queries
    Replies: 6
    Last Post: 06-30-2009, 02:39 PM
  5. HELP with Delete Query
    By brown in forum Queries
    Replies: 1
    Last Post: 04-22-2009, 10:11 PM

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