updating two tables

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • thomanjl

    updating two tables

    Okay, here is my issue:
    I have an access program that tracks the location of certain items.
    When the items are moved their record will be added with transfer
    information.

    So, there are two tables: tblContents and tblTransfer

    tblContents holds all the relevant information about each item as well
    as a flag for transferred items and tblTransfer holds all the
    transferred item information.

    My problem is: How do I update tblTransfer when an item in tblContents
    gets flagged true?

    btw, this is using a .asp front end to interact with the database.

  • Ed Murphy

    #2
    Re: updating two tables

    thomanjl wrote:
    I have an access program that tracks the location of certain items.
    When the items are moved their record will be added with transfer
    information.
    >
    So, there are two tables: tblContents and tblTransfer
    >
    tblContents holds all the relevant information about each item as well
    as a flag for transferred items and tblTransfer holds all the
    transferred item information.
    >
    My problem is: How do I update tblTransfer when an item in tblContents
    gets flagged true?
    >
    btw, this is using a .asp front end to interact with the database.
    Define a trigger on tblContents, something like this:

    create trigger trgTransfer on tblContents for insert, update as
    insert into tblTriggers
    select <list of fields>
    from inserted
    go

    Since this is at the database level, it is completely independent
    of the Access and .ASP layers.

    Comment

    Working...