Solved

How to remove (not delete !) a link record from a junction table

Posted on 2014-11-05
2
246 Views
Last Modified: 2014-11-08
I have a database with a junction table:

Clients  1>m  Contracts  1>m  link  m<1  Scanners  1>m  reports

Contracts can be added; modified or deleted; this includes adding and removing scanners.
on removing a scanner from a contract I would (I think) need to delete the associated link from the junction table.  However, there are reports for scanners which I must keep.

I've setup a couple of forms to enable me to add contracts and scanners but I do not know how to remove scanners from existing contracts.  Can the link be updated (delete and add) to move the scanner to an "obsolete contract"  -  or is there a better way to handle this removal ?

Thanks
Brian
0
Comment
Question by:Eur0star1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Accepted Solution

by:
rspahitz earned 500 total points
ID: 40424334
If I understand you correctly, you have a many-to-many table called links, which has pointers to the Contracts and Scanners tables.  Each of the records in this table indicates how any Contract can connect to any Scanner.
To remove any one of these, you would normally just remove the record and the connection between the two is gone.

If you want to retain that connect (for audit purposes, for example) you could change the Link table to contain another field called something like "Active" and set the default to True.  Then when you want to disable the connection, set this to False.  However, you will need to update all of your reports to query where Link-table Active = True.
0
 

Author Comment

by:Eur0star1
ID: 40425713
That seems a straightforward way of doing  what I need.  I could also add some additional fields to the link and I could add dates to the link which might provide a history.

I thought I would need some DAO to achieve this - which I would be pleased if you could give me a link to a suitable article on this.

Thanks - I have a solution
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question