Welcome to SPN

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

Sign Up Now!

can a new record be added to two 1-1 relational tables at once

Discussion in 'Information Technology' started by Jennifer, Jul 28, 2006.

  1. Jennifer

    Jennifer
    Expand Collapse
    Guest

    I have several tables linked one to one with my main contact table. Can a
    new record be automatically added to those tables when a new record is added
    to the main table? If so How???????
    I though that I knew but nothing I try is working. They are all one to one
    and referential integrety and cascade delete and update are all checked.
    I didn't think adding them manually would be a problem but my end users are
    all complaining about remembering to do it and having to know the ID from the
    main contact. Thanks for any help
     
  2. Loading...


  3. Rick B

    Rick B
    Expand Collapse
    Guest

    I did this once. To do so, I included all the tables in my query and built
    a form using that query as the record source. Then, I included all the
    fields from my main table in my form. I also added the key field (in my
    case, EmployNum) from each of the related tables. I made this field
    invisible. In my before update code for my visible EmployNum field, I
    included code to copy that value to the invisible controls. This created a
    blank record in each of the related tables.

    Generally, this is not a really good idea. If your tables are 1-to-1 then
    they could probably all be in one table. I did it because I really wanted
    to separate some employee data and have more control over who could access
    part of the record.

    In any case, that scenario should help you.

    --
    Rick B



    "Jennifer" <Jennifer@discussions.microsoft.com> wrote in message
    news:F09A86C5-ED54-4910-BDF5-F222BF4F242D@microsoft.com...
    >I have several tables linked one to one with my main contact table. Can a
    > new record be automatically added to those tables when a new record is
    > added
    > to the main table? If so How???????
    > I though that I knew but nothing I try is working. They are all one to
    > one
    > and referential integrety and cascade delete and update are all checked.
    > I didn't think adding them manually would be a problem but my end users
    > are
    > all complaining about remembering to do it and having to know the ID from
    > the
    > main contact. Thanks for any help
     
  4. SuzyQ

    SuzyQ
    Expand Collapse
    Guest

    why not use a subform within a form. When they add to the main table via the
    form, the subform is visible on the form and you can require them to add the
    necessary records to the related table before they exit the form.

    "Jennifer" wrote:

    > I have several tables linked one to one with my main contact table. Can a
    > new record be automatically added to those tables when a new record is added
    > to the main table? If so How???????
    > I though that I knew but nothing I try is working. They are all one to one
    > and referential integrety and cascade delete and update are all checked.
    > I didn't think adding them manually would be a problem but my end users are
    > all complaining about remembering to do it and having to know the ID from the
    > main contact. Thanks for any help
     

Share This Page