Updating records in related tables...

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

    Updating records in related tables...

    Is it possible to add a record in one table and have Access automatically
    add date from one of the fields into another table??

    In more detail:

    Table1 has the following fields: Product_ID, Price, Weight etc...
    Table2 has the following: Product_ID, Category, Department

    I need to add a new product into Table1 and automatically have the
    product_id added to Table2.

    Anyone care to enlighten me - or point me in the direction of a tutorial??

    Many thanks.




  • Allen Browne

    #2
    Re: Updating records in related tables...

    Access lacks triggers, so you cannot do this automatically at the engine
    level.

    If products are always entered into a form, you can use the AfterInsert
    event of the form to Execute an Append query statement to insert a record
    into Table2.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Support" <a@b.com> wrote in message
    news:402b833b$0 $11665$65c69314 @mercury.nildra m.net...[color=blue]
    > Is it possible to add a record in one table and have Access automatically
    > add date from one of the fields into another table??
    >
    > In more detail:
    >
    > Table1 has the following fields: Product_ID, Price, Weight etc...
    > Table2 has the following: Product_ID, Category, Department
    >
    > I need to add a new product into Table1 and automatically have the
    > product_id added to Table2.
    >
    > Anyone care to enlighten me - or point me in the direction of a tutorial??[/color]


    Comment

    • paii, Ron

      #3
      Re: Updating records in related tables...

      You could use relationships to link Product_ID in tables 1 and 2. A new
      Product_ID could not be added to table 1 unless there was a record in table
      2 with that product ID. Anyone needing a new Product_ID would have to 1st
      enter it into table1.

      "Support" <a@b.com> wrote in message
      news:402b833b$0 $11665$65c69314 @mercury.nildra m.net...[color=blue]
      > Is it possible to add a record in one table and have Access automatically
      > add date from one of the fields into another table??
      >
      > In more detail:
      >
      > Table1 has the following fields: Product_ID, Price, Weight etc...
      > Table2 has the following: Product_ID, Category, Department
      >
      > I need to add a new product into Table1 and automatically have the
      > product_id added to Table2.
      >
      > Anyone care to enlighten me - or point me in the direction of a tutorial??
      >
      > Many thanks.
      >
      >
      >
      >[/color]


      Comment

      Working...