Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2002
    Posts
    9

    Question Unanswered: Automatically updating primary key info in tables

    Hi there,

    Any help would be HUGELY appreciated.

    I have a database with 16 tables. The Company name listed in each table should always be the same.

    The problem is, these tables are maintained by a large number of people. Also, company names are added and deleted every day. I'd like to set up the 'Base Info' table as the primary table.

    Is it possible to have all the other 15 tables update automatically (as in, delete, update and add new company names) after making such a change within the Base Info table?

    The company name has been set as the primary key in all 16 tables.

    Thanks in advance!
    T.

  2. #2
    Join Date
    Mar 2003
    Location
    London
    Posts
    40

    Re: Automatically updating primary key info in tables

    Originally posted by TC123
    Hi there,

    Any help would be HUGELY appreciated.

    I have a database with 16 tables. The Company name listed in each table should always be the same.

    The problem is, these tables are maintained by a large number of people. Also, company names are added and deleted every day. I'd like to set up the 'Base Info' table as the primary table.

    Is it possible to have all the other 15 tables update automatically (as in, delete, update and add new company names) after making such a change within the Base Info table?

    The company name has been set as the primary key in all 16 tables.

    Thanks in advance!
    T.

    1) Tools->Relationships
    2) Add 'Base Info' and 15 tables
    3) Establish 1 to many relationships from 'Base Info' to 15 other tables
    4) When establishing, check 'Enforce referential intergrity' and Cascase delete, Cascade Update

    this will take care of deletes and updates, but not additions though.

    Do you really have to automate additions?

    Be very carefull with permissions on 'Base Info', as one slip of a finger can cause devastation to your database.

  3. #3
    Join Date
    Nov 2002
    Posts
    9

    Re: Automatically updating primary key info in tables

    Originally posted by yk58301
    1) Tools->Relationships
    2) Add 'Base Info' and 15 tables
    3) Establish 1 to many relationships from 'Base Info' to 15 other tables
    4) When establishing, check 'Enforce referential intergrity' and Cascase delete, Cascade Update

    this will take care of deletes and updates, but not additions though.

    Do you really have to automate additions?

    Be very carefull with permissions on 'Base Info', as one slip of a finger can cause devastation to your database.
    Thanks for the help! I've created those relationships.

    Unfortunately, automatic additions from Base Info are needed. Any ideas?

  4. #4
    Join Date
    Mar 2003
    Location
    London
    Posts
    40

    Re: Automatically updating primary key info in tables

    Originally posted by TC123
    Thanks for the help! I've created those relationships.

    Unfortunately, automatic additions from Base Info are needed. Any ideas?
    Can you be more specific about how you add records to base info?

    If you use a form then you can use events to run code which will automatically add records to the rest of the tables

  5. #5
    Join Date
    Nov 2002
    Posts
    9

    Smile Re: Automatically updating primary key info in tables

    Originally posted by yk58301
    Can you be more specific about how you add records to base info?

    If you use a form then you can use events to run code which will automatically add records to the rest of the tables
    Well, as of right now, people just type them into the tables. So some will have 200 company names, some 10. I'd like to make sure all tables are the same.

    I've never used a form before. Would this be hard to set up?

    Thanks!

  6. #6
    Join Date
    Mar 2003
    Location
    London
    Posts
    40

    Re: Automatically updating primary key info in tables

    Originally posted by TC123
    Well, as of right now, people just type them into the tables. So some will have 200 company names, some 10. I'd like to make sure all tables are the same.

    I've never used a form before. Would this be hard to set up?

    Thanks!
    If you never used a form before try using form wizards. Once you've done that, we can come up with appropriate code.

    Alternatively send me the zipped database (is it Access 2000?) and I'll come up with something applicable to your specifics.

    P.S. Can they all type into 1 table?

  7. #7
    Join Date
    Nov 2002
    Posts
    9

    Re: Automatically updating primary key info in tables

    Originally posted by yk58301
    If you never used a form before try using form wizards. Once you've done that, we can come up with appropriate code.

    Alternatively send me the zipped database (is it Access 2000?) and I'll come up with something applicable to your specifics.

    P.S. Can they all type into 1 table?
    Sorry - I'm not sure what you mean when you say "can they all type into 1 table".

    I made a form using the wizard. I only added the fields from Base Info. Now I'm lost. =)

    I really wish I could send you a copy of the database, but I'd probably be hung if I sent it out. It's all confidential government stuff. =(

  8. #8
    Join Date
    Mar 2003
    Location
    London
    Posts
    40

    Re: Automatically updating primary key info in tables

    Originally posted by TC123
    Sorry - I'm not sure what you mean when you say "can they all type into 1 table".

    I made a form using the wizard. I only added the fields from Base Info. Now I'm lost. =)

    I really wish I could send you a copy of the database, but I'd probably be hung if I sent it out. It's all confidential government stuff. =(
    By 'Can they all type into 1 table?' I meant that if you have many users updating company info in different tables, maybe they could all use 1 table instead.

    If you can't send me your database with the data, maybe you can make a copy, clear all data from it, and send me just the structure.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •