Results 1 to 3 of 3
  1. #1
    mattylance is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2015
    Posts
    2

    Delete Query that is dependent on values in a separate table

    Hello, I have a question on how to create a delete query that is dependent on the values in another table. My scenario:



    TableA: Linked SQL table, no access to backend to modify or add fields. The fields are: Product, Date and Quantity.

    TableB: Table that users enter values in to the one field which is also called Product.

    QueryA: Want to create a delete query that will delete records from TableA. I need it to delete only if the Product value is in TableB and also utilizing criteria on the Date field ( i.e. Between [Start Date] And [End Date].

    To give context, TableA is a list of products, with quantities entered by week. If the user maintains a product in TableB, when they run QueryA it will delete out any of the products from tableA that correspond.

    Any help greatly appreciated.
    Thanks
    Matt

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Use the query wizard to make a FIND DUPLICATE qry.
    Then examine it...just change it from select to delete.

    you must use the IN sub qry method employed there. (NOT by linking tbls)

  3. #3
    mattylance is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Apr 2015
    Posts
    2
    Thanks for the reply. I guess I don't understand how to incorporate TableB into your response. Please advise when you have a moment.

    Thanks

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

Similar Threads

  1. Replies: 1
    Last Post: 11-11-2014, 12:21 AM
  2. Replies: 11
    Last Post: 06-19-2014, 09:22 PM
  3. Replies: 10
    Last Post: 05-22-2013, 02:56 PM
  4. Replies: 2
    Last Post: 01-24-2012, 02:16 PM
  5. Help with dependent values
    By ceejsing in forum Access
    Replies: 6
    Last Post: 08-05-2011, 06:36 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