Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

How do I enter the same record on two tables simultaneously?

Discussion in 'Information Technology' started by NAguilu, Nov 10, 2005.

  1. NAguilu

    NAguilu
    Expand Collapse
    Guest

    I have two tables that are related. I would like to find a way that if a key
    that is on the first table is not on the second, a new record would be
    automatically created with the missing key in the second table.
     
  2. Loading...


  3. Rick B

    Rick B
    Expand Collapse
    Guest

    Why? Do you have a one-to-one relationship?

    If you have a one-to-many, you should have your main table as the forms
    record source, and your related table (many) as the source of your subform.
    Then, you'd create a main record and one or more related records.

    --
    Rick B



    "NAguilu" <NAguilu@discussions.microsoft.com> wrote in message
    news:89072AF5-1AE3-4BD4-AD5D-B7DAF9B79CE3@microsoft.com...
    >I have two tables that are related. I would like to find a way that if a
    >key
    > that is on the first table is not on the second, a new record would be
    > automatically created with the missing key in the second table.
     
  4. Ofer

    Ofer
    Expand Collapse
    Guest

    Most important, Back up your data first
    ========================================
    Using the Query wizaed, create an UnMatch records query, that return the
    records that are in table A but not in table B, link by the key, and display
    return the Key field.
    When you get the desire resault, change this select query to append query,
    and append all the missing records in table B
    ========================================
    Or, if you want to append only one field, key field, just run an append
    query on all the records, it will skip the records that already there,
    because of violation of primary key, so you end up with the new records only
    in table B

    --
    The next line is only relevant to Microsoft''s web-based interface users.
    If I answered your question, please mark it as an answer. It''s useful to
    know that my answer was helpful
    HTH, good luck


    "NAguilu" wrote:

    > I have two tables that are related. I would like to find a way that if a key
    > that is on the first table is not on the second, a new record would be
    > automatically created with the missing key in the second table.
     
  5. John Vinson

    John Vinson
    Expand Collapse
    Guest

    On Wed, 9 Nov 2005 06:05:04 -0800, "NAguilu"
    <NAguilu@discussions.microsoft.com> wrote:

    >I have two tables that are related. I would like to find a way that if a key
    >that is on the first table is not on the second, a new record would be
    >automatically created with the missing key in the second table.


    It's almost NEVER either necessary or beneficial to create such an
    empty "placeholder" record.

    Could you explain why you wish to do so, and why it wouldn't be
    acceptable to do the usual thing - enter data into the second table
    using a Subform, which will automatically fill in the ID when (and
    only when) there is data added to the second table?

    John W. Vinson[MVP]
     

Share This Page