Welcome to SPN

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

Sign Up Now!

Automatically add new records to multiple tables?

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

  1. BWN

    BWN
    Expand Collapse
    Guest

    I need to automatically add 1 record (with a default value of 0/not null) to
    multiple related tables, easily done through say with a click of a command
    button. Is this possible?

    The purpose for this is to achieve a summary of totals for a specific set of
    records from different tables, and I know I can do this using subforms,
    however with about 6 tables there would just be too many subforms to be
    placed in 1 form.
     
  2. Loading...


  3. Pieter Wijnen

    Pieter Wijnen
    Expand Collapse
    Guest

    You can use a union query to achieve it

    SELECT SUM(AMOUNTFIELD) FROM TABLE A
    UNION ALL
    SELECT SUM(AnotherAmountField) FROM TABLE B
    .....

    you must only make sure to have the same number of "compatible" fields in
    each select

    HTH

    Pieter

    "BWN" <BWN@discussions.microsoft.com> wrote in message
    news:9E25F728-0F3E-4D0D-90D2-6623E4A61936@microsoft.com...
    >I need to automatically add 1 record (with a default value of 0/not null)
    >to
    > multiple related tables, easily done through say with a click of a command
    > button. Is this possible?
    >
    > The purpose for this is to achieve a summary of totals for a specific set
    > of
    > records from different tables, and I know I can do this using subforms,
    > however with about 6 tables there would just be too many subforms to be
    > placed in 1 form.




    --
    ----------------------------------------
    I am using the free version of SPAMfighter for private users.
    It has removed 4231 spam emails to date.
    Paying users do not have this message in their emails.
    Get the free SPAMfighter here: http://www.spamfighter.com/len
     

Share This Page