Solved

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

Posted on 2014-11-05
2
231 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
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now