Results 1 to 5 of 5
  1. #1
    mmcgibbony is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    3

    Question Creating a delete query

    I have created a query of two tables, Table 1 and Table 2. I have joined the two tables on the field FedID where I have selected to show all values where I list all values in table 2 that are equal to those in table 1. I get a return quantity of 4800 records.

    I want to delete these records from Table 1. I click the delete query icon and hit run. It says that I must select which table I'd like to delete the records from. I can't find how to select which table I want to have these records deleted from.

    I can't find the answer to my problem. I've looked at videos and online but all of the information I get points me to VBA stuff that I can't decipher. Can anyone help me with this?



    Thanks a ton!
    Mike

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Maybe:

    DELETE FROM Table1 WHERE FedID IN (SELECT FedID FROM Table1 INNER JOIN Table2 ON Table1.FedID = Table2.FedID
    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
    mmcgibbony is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    3
    Thanks, June7. I see this as the possible solution that you have kindly provided to me:

    DELETE FROM Table1 WHERE FedID IN (SELECT FedID FROM Table1 INNER JOIN Table2 ON Table1.FedID = Table2.FedID

    It creates a couple of questions to help me to clarify my next actions.
    1. I see a SELECT command. That is SQL to me. I don't see a closed parentheses at the end of the statement. I understand the logic of the command but I can't tell where to put the command.
    2. The mechanics of what I'm doing was
    - After creating my SELECT Query in Access
    - I clicked the Delete Query button and then clicked RUN
    - I got an error.
    - Where do I go in Access to either enter this statement or execute the equivalent. I'm so lost.....

    Thanks again for the help and clarification.

    Mike

    Last edited by mmcgibbony; 09-22-2014 at 06:45 AM. Reason: Did not finish and hit the wrong button!

  4. #4
    mmcgibbony is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2014
    Posts
    3

    Wink Great help!!!!!!

    With your help, I was able to execute the DELETE Query. I really appreciate the help. IT WORKED!

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Glad you figured it out. The forum converted ) ; into emoticon in earlier 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.

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

Similar Threads

  1. Delete Query (help please)
    By dlingley in forum Queries
    Replies: 12
    Last Post: 04-04-2013, 09:19 AM
  2. Replies: 2
    Last Post: 04-25-2012, 08:14 AM
  3. Replies: 2
    Last Post: 01-24-2012, 02:16 PM
  4. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM
  5. Replies: 11
    Last Post: 03-30-2011, 01:08 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