There's actually quite a few different ways to handle this.
Many people opt to keep one field as a flag for the status. I do this, it's
either the second or third field in each table, and I call it fldStatus, of
the Byte datatype (less memory than Yes/No, among a few other complications).
Anyway, 1 = Active, 0 - inactive. I keep this indexed, and then each time I
use a form it queries for only active records (WHERE fldStatus = 1).
This keeps all your data in one table, and any detail records for an
inactive record won't be viewed by the user, as it's parent isn't part of the
recordset that they deal with. It makes it easy to retain records of all
contacts, either active or inactive.
Another advantage is, say you do a job for a customer with an active
contact, and 6mo later that contact is no longer active. But now, you may
want to see some history on that job, and even though the contact isn't
active, you may still want to see what contact it was, whether its still
active or not. Keeping both inactive and active contacts in the same tables
lets you do this without any special workarounds. (this scenario becomes an
issue when changes are made to data as well... sometimes you want to see the
original, rather than the changed).
Yet another option is to write these inactive records to an archive table.
Here's some info on that
http://www.allenbrowne.com/ser-37.html
--
Jack Leach
www.tristatemachine.com
- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
"Allison" wrote:
> I replied just a second ago saying I didn't want to delete the parent. But,
> maybe I do? Is it possible to capture the data being deleted from the table
> and then write that to a different table?
>
> I'm guessing I could then go ahead and delete the parent (and all its
> children) but still keep the info I want in that different table. Is that a
> better way? How would I do that?
>
> Allison
>
> "dymondjack" wrote:
>
> > If you have one-to-many relationships set up with cascading deletes enabled,
> > you should be able to delete the parent record and have all related records
> > deleted with them as well.
> >
> > Another way would be to query for records that contacts your ContactID that
> > is now inactive.
> >
> > Dim lngID as Long
> > lngID = 1 'Or whatever ID you want to delete
> >
> > "DELETE * FROM tblComboContactType WHERE fldContactID = " & lngID
> >
> > This would delete any records from the said table that has a matching
> > contact ID.
> >
> > hth
> >
> > --
> > Jack Leach
> > www.tristatemachine.com
> >
> > - "First, get your information. Then, you can distort it at your leisure."
> > - Mark Twain
> >
> >
> > "Allison" wrote:
> >
> > > Access 2003, Win XP SP 3
> > >
> > > I have a field in tblContacts called fldInactive. This is a Yes/No field.
> > >
> > > I also have several other table relations where the unique fldContactID has
> > > been associated with other related tables. One example is
> > > "tblComboContactType", which contains a record that captures ContactID, and a
> > > classification ID combination.
> > >
> > > I want to delete all of the related associations for the ContactID when
> > > someone indicates that the contact is now inactive.
> > >
> > > I'm guessing this will have to look at every table except tblContacts, then
> > > delete any record that contains the ContactID?
> > >
> > > How would I do this?
> > >
> > > Allison