Results 1 to 8 of 8
  1. #1
    ldavis is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    4

    Need to combine linked tables into one table that will auto update


    I have linked tables in my database for each month of the year with the exact same fields (ex. Nov2010, Dec2010, Jan2011, etc.). What I need to do is combine all the data into 1 table or query but I need that combined table to automatically update when the linked tables update. Is there a way to do this? I already know how to use the append query but this doesn't work for me because it does not update when data in the individual tables change.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    I'm not quite following your question. Could you give a simple example of your tables and what you want your result to be, it seems like you want to be able to enter a new record on TableA and have it automatically look up a value from TableB but I'm getting lost in your description a little.

  3. #3
    ldavis is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    4
    rpeare,

    Thank you so much for the fast reply.

    Here is my table layout:

    Linked Tables:
    Oct2010
    Nov2010
    Dec2010
    Jan2011
    Feb2011

    Other Tables:
    AllData (this table will combine data from all the tables)

    The data in the linked tables above is constantly changing. I need the AllData table to constantly update based on those changed from the monthly tables.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    whoa, that's very bad design if each month of activity has it's own table. Do you have any control over the design of this database?

    Instead of having

    Table:
    Oct2010 with relevant fields

    why not have

    Table:
    Activity
    Month >other exiting fields in each current table
    Oct2010

    It's going to be impossible for you to write a static query that will combine all your tables into one query. You will have to continually modify your query or have a form that helps you build a SQL statement based on which month tables you include in your query.

    Let me restate, what you've said you have is a very poor choice for table design and if you have any control over it at all I would strongly suggest you change your database to a more normalized structure.

    What you're asking to do can be done with a UNION query

    SELECT * FROM <tablename1>
    UNION ALL
    SELECT * FROM <tablename2>
    UNION ALL
    SELECT * FROM <tablename3>
    ..etc

    will work as long as the table design is identical across all the tables.

  5. #5
    ldavis is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    4
    I was afraid of that. My client needs the data by month in excel which is why I have the database structured that way. Thank you so much for your help.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    You can give your client the data in any format they want as long as you're collecting the information. You can convert to the structure I mentioned and still be able to give your clients a month by month accounting, you would just change your exporting procedure to export a query (which limits the data to the stuff they want to see) as opposed to exporting an entire table.

  7. #7
    ldavis is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Posts
    4
    I have been considering a re-structure. So what you suggest is to have all the data in one table instead of by month right?

  8. #8
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Exactly right. The only thing you would have to do to your table structure is to add one more field. Then for all the information you append to the new 'combined' table is to add the MONTH of the data you're adding which you could mimic by using your current table naming convention.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 01-22-2011, 12:23 PM
  2. Replies: 0
    Last Post: 11-30-2010, 12:23 PM
  3. Replies: 3
    Last Post: 01-21-2010, 08:10 PM
  4. Auto-updating fields in linked tables?
    By Leelers in forum Database Design
    Replies: 27
    Last Post: 01-08-2010, 06:23 PM
  5. auto update of two linked tables
    By colenzo in forum Access
    Replies: 4
    Last Post: 07-20-2009, 09:08 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums