Results 1 to 15 of 15
  1. #1
    Join Date
    Jan 2012
    Posts
    8

    Merge linked tables!

    Hello,



    I've linked 4 tables from Excel into Access. How do I go about merging these 4 tables into a master table and have it updates as the new values are being added to the original tables?

    P.S. I've tried to append all 4 sources into 1 table, but it would not update. HELP

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    The original tables will not 'update' a master table. Why would you need the 'master' table? Use queries to view data of related tables (in this case the tables are Excel links).

    Describe the data structure and relationships and what you really need to accomplish. Why are you linking to Excel and not using Access tables?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Join Date
    Jan 2012
    Posts
    8
    I need to track cases that I assigned to other people. Each of them have their own workbook in excel format, because of the formulas and conditional formattings being used. They're password protected to avoid changes made by other users. I want to have a master worksheet for easy tracking and reports. I've tried to link all 4 tables using excel, it updates previous entries but will not add new entries (I used the cell-cell linking method).
    So now, I'm hoping Access would enable me to do so. I've been playing it with for a while but I'm running into a dead end. Any suggestion?

    Thanks in advance.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    If you only need to view the user's worksheets and not input data, then a query should work. Are these workbooks all identical in structure (same columns)? If so, I think you need a UNION query to 'merge' the 4 links into one dataset structure. The UNION will be dynamic so that changes made to the workbooks will feed through the links. There is no designer or wizard for UNION, must type in the SQL View of query designer. There is a limit of 50 lines. Example if all 4 workbooks have columns with same names and same order:

    SELECT "WB1" AS Source * FROM workbooklink1
    UNION ALL SELECT "WB2", * FROM workbooklink2
    UNION ALL SELECT "WB3", * FROM workbooklink3
    UNION ALL SELECT "WB4", * FROM workbooklink4;

    If there is any variation in the structures, must explicitely name the fields in each row (be thankful for copy/paste). The first line will establish the fieldnames for the merged set. Hence the alias Source in the example.

    Now can use this query for filtering/sorting/searching all records and as basis for forms/reports.

    Be sure to verify the query results. I just did a test with a linked workbook and a table. When I put the workbook as first line in the UNION, not all records were retrieved. When I put it as second line, all records retrieved. So be aware that UNION retrieves only unique records unless the ALL keyword is used and because the ALL keyword is not on the first line and the workbook has duplicate values for the field I selected on, the total record count was less than the original set.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Join Date
    Jan 2012
    Posts
    8
    Okie. I linked the worksheets into access, created union query. Everything worked as I wanted, but when I went back to encrypt the original worksheets. The query and the tables won't open in Access.

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    What do you mean by 'encrypt'?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Join Date
    Jan 2012
    Posts
    8
    Password protected.
    Because the files will be on a shared drive containing personnel info, they have to be password protected. Is there any way to go around this?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Review this, about halfway down to 'You Cannot Open a Password-Protected Workbook'
    http://support.microsoft.com/kb/257819
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    Join Date
    Jan 2012
    Posts
    8
    Yeah, I figured that's the only to make it work. It's such a pain to ask all users to open their files just so I can do what I need to do. I guess we just have to deal with that for now.

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    The alternative is an Access-only (no Excel component) database, which makes more sense to me.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    Join Date
    Jan 2012
    Posts
    8
    How would I go about adding formulas to the table in Access? I'm not very good with writing codes. That's the only reason I went with Excel
    I have a lot of if-then formulas in the Excel tables for a certain column. So say this is how my table looks like

    Name | Initiation Date | 1st Reminder | 2nd Reminder | Status

    In "1st Reminder", cases that's 5 days old from "Initiation Date" to change to "DUE", and 6 days to change to "OVERDUE"
    In "2nd Reminder", cases that's 7 days change to "DUE", over 7 days to "OVERDUE", =>10 days to "TERMINATED"
    Also, cases with "Completed" status to be replaced with X.

    It would be AWESOME if you could figure this one out for me.

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    Cannot do calculations in tables (unless you upgrade to Access 2010). Do calculations in queries. Use an expression to create a field in query. This query and its fields (constructed or natural) can be referred to just like a table.

    Expressions you describe would be like:
    1st Reminder: IIf([Initiation Date] < Date() - 5, "OVERDUE", "DUE")
    2nd Reminder: IIf([Initiation Date] <= Date() - 10, "TERMINATED", IIf([Initiation Date] < Date -7, "OVERDUE", Null))

    You want an X in Status column? This could be a Yes/No field. Just click to set value. What criteria determines 'Completed' status?

    Calculations can also be done in textboxes on forms and reports.

    Everything you are now doing in Excel can probably be done in Access, even control what records each user is allowed to work with. Access is the tool for managing data. Excel is a tool for heavy calcs, such as what-if scenarios.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  13. #13
    Join Date
    Jan 2012
    Posts
    8
    OMG! It works. This is so COOL!!!!
    One more question . Is there a way to make a drop down menu in the text field?

  14. #14
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    On a form that would be a combobox with a RowSource.

    In a table in Design view, this would be on the Lookup tab. (Slap my hand for mentioning). I NEVER set Lookup in table. I want to see the real value in the field when I view tables. Developers normally do not build databases that allow users to interact directly with tables and queries nor allow them to do design changes by disabling developer tools. Look at http://access.mvps.org/access/tencommandments.htm

    You are asking questions about very basic Access functionality. I suggest you get an introductory tutorial book like 'Access in 10 Minutes'. It will probably be a faster learning process than trying to pick our brains with another question every 5 minutes and maybe not even getting a response here. The tutorial will introduce you to what you need to know to be competent with basics. Spend a weekend with it, do some practice exercises, then start your project.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  15. #15
    Join Date
    Jan 2012
    Posts
    8
    I will do that this weekend. Thanks again for your help.

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

Similar Threads

  1. Join/merge/mix tables problem
    By niculaegeorge in forum Queries
    Replies: 2
    Last Post: 07-10-2011, 08:39 AM
  2. Replies: 3
    Last Post: 03-27-2011, 03:02 PM
  3. Mail merge from two access tables
    By Peter in forum Access
    Replies: 2
    Last Post: 08-24-2010, 12:17 PM
  4. Mail Merge w/ data from 2 tables
    By sedain121 in forum Import/Export Data
    Replies: 3
    Last Post: 06-30-2010, 09:43 AM
  5. How do I Merge Four Tables Together
    By SteveI in forum Queries
    Replies: 1
    Last Post: 03-04-2010, 10:53 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