Results 1 to 6 of 6
  1. #1
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672

    Re-Link 1 Table in Multiple Databases via VBA

    I have found a few ways to re-link tables via VBA, but is there a way to create a database, and then create an array in VBA of workbooks to open, then once the workbook is opened run the re-link code, close the db and move onto the next database?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I found quite a few links based on this google search parm

    opening multiple msaccess databases with vba
    Good luck.

  3. #3
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    Quote Originally Posted by orange View Post
    I found quite a few links based on this google search parm



    Good luck.
    Oh no, is this not a feasible solution?

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Workbooks? Access

    Perhaps you should tell us clearly WHAT you are trying to do.

  5. #5
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    Quote Originally Posted by jo15765 View Post
    I have found a few ways to re-link tables via VBA, but is there a way to create a database, and then create an array in VBA of workbooks to open, then once the workbook is opened run the re-link code, close the db and move onto the next database?
    I have about 200 access databases with a linked SQL Table that I need the table link refreshed. So instead of manually doing each and every database I was going to try to VBA it somehow..

  6. #6
    jo15765's Avatar
    jo15765 is offline Expert
    Windows XP Access 2000
    Join Date
    Nov 2010
    Location
    6 Feet Under
    Posts
    672
    I have my code to import the SQL table, and I have my code to cycle the databases, but the snippet I am using is:
    Code:
    Dim tdf As DAO.TableDef
    
    Set tdf = Currentdb.CreateTableDef
    But I want to (this is excel terms I know) change focus from the db I am running this code in, to the db I just opened to create the table in. Is this possible?

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

Similar Threads

  1. Switching between multiple databases
    By developer11 in forum Access
    Replies: 2
    Last Post: 11-16-2020, 05:56 AM
  2. Replies: 2
    Last Post: 10-11-2012, 02:29 PM
  3. How to link two databases
    By RobinRBrown in forum Access
    Replies: 2
    Last Post: 06-14-2012, 03:45 AM
  4. Connect Multiple Databases
    By bouschie in forum Database Design
    Replies: 3
    Last Post: 05-06-2011, 10:16 AM
  5. Replies: 6
    Last Post: 09-30-2010, 11:12 AM

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