Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Location
    Ft. Lauderdale, Florida
    Posts
    8

    Unhappy Unanswered: delete records from one table based on records from another table

    Good Evening All,
    im not sure if im posting this question into the right forum but here goes

    i have a database with two tables. one table we will call tblmain and the other tblmain2.
    tblmain is huge list with client information in it like name, address, phone etc. tblmain2 is a list of clients that are not supposed to be called. it is a do not call list that has clients first name, last name and phone number. is there a way that on one form i could set up a command button so when clicked if any clients in tblmain that are also in the do not call list(tblmain2) be deleted from tblmain? im thinking of using the phone number field in both to match the info.

    ps these to tables were already imported from excel and already have 100's of records in them.
    i hope that this info is clear enough.

    Thanks in advance
    Shane
    Attached Thumbnails Attached Thumbnails 3gcwhite_xtr.gif  

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    delete & SUb query

    DELETE *
    FROM Table1
    WHERE TELNO in (SELECT Table2.TELNO FROM Table2)

  3. #3
    Join Date
    Sep 2003
    Location
    Ft. Lauderdale, Florida
    Posts
    8
    thank you very much that worked great!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •