Results 1 to 3 of 3
  1. #1
    TedT is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    10

    Deleting record and related records

    I have a database where I have records related to other records, using a unique ID in the main table and duplicate ID's in the second. There are times I want to delete the main record, and need to delete all the related records in the subform (table).



    How do I do this?

    Thanks
    TedT, California

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    If you have relationships set and have the Referential Integrity checkbox checked and check the CASCADE DELETES checkbox, whenever you delete a parent record, any child records will also be deleted.

  3. #3
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    furthermore, if you want that as an OPTION, you probably have 2 options:

    1) turn relationships 'ON AND OFF' with code when needed (can be found on Allen Browne's website)

    2) query all the dependent records out in code when you need them and run a delete query on them.

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

Similar Threads

  1. Replies: 12
    Last Post: 09-09-2011, 11:14 AM
  2. query won't display records with no related records
    By James Brazill in forum Queries
    Replies: 1
    Last Post: 06-28-2011, 02:10 AM
  3. Replies: 6
    Last Post: 09-01-2010, 03:12 PM
  4. deleting records
    By radicalrik in forum Queries
    Replies: 2
    Last Post: 07-14-2010, 03:10 PM
  5. Deleting Record Contents, not complete record...
    By Charles Waters in forum Access
    Replies: 2
    Last Post: 06-24-2008, 12:00 PM

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