Solved

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

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

809 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