How To Have Access VBA Link Tables Programmatically

This table relinking procedure is a really good example of how to use VBA to link your tables programmatically, and how to have MS Access refresh linked tables automatically.

It allows re-linking all tables to a selected drive source (the folder the backend database is in).

In this example, all of the tables that need to be relinked are in the “LinkTables” table, and the backend database is in the “C:\Interface\20180314” folder:

IMPORTANT: All Backend databases must reside in the same path, and name of file listed in table. If the tables are not in the same backend database, then the code needs to be modified.

I am interacting with this procedure from a form that looks like this:

Here’s the code for the form:

Here’s the code of how to call the “RefreshLink” procedure:

Here are the Front End and the Backend databases for you to practice with (Make sure your path is correct):

Here is the front end:
How To Have Access vba link tables programmatically.accdb

Here is the backend database:

Air.accdb

Let me know if you have any questions.



Free! Subscribe To Our YouTube Channel!

facebooktwittergoogle_plusredditpinterestlinkedinmailby feather
Tags: , ,




 

Call Erik Now