Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page