Solved

Access 2007 VBA - Relink database tables from code

Posted on 2011-02-16
2
1,362 Views
Last Modified: 2012-05-11
The Access project I'm working on is divided into two access files, one is the back end that holds all the tables and the data.  The other is the User interface that holds all the forms and reports and imports the tables as linked tables.

If the back end is ever moved then the front end has to relink the tables through the linked table manager.  This application is being built for less savvy computer users and I have a requirement to add functionality to place a button on the main switchboard that will prompt the user for the file location of the back end and update the linked tables.

I've found the following...

http://www.fabalou.com/Access/Modules/refreshtables.asp

which looks like it will work, but I need to have the path before this will be effective.  I would rather not have the user need to type in the path, but rather when they click on the button I would rather have it open an explorer window to have them navigate to and select the file.  I would like to take that path and feed it into this method.

Currently when you go into the Linked Table Manager and relink tables it opens up a file search window for you to navigate to your access file.  I would like to mimic this functionality from a button.

If anyone has a better solution than the way I'm going about this, I would also be open to that.

Thanks
0
Comment
Question by:JosephEricDavis
2 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 34908005
see this sample db


you can select the file by clicking on the button select file
browse-Q-26825705.mdb
0
 
LVL 7

Author Comment

by:JosephEricDavis
ID: 34908688
Oops, what happens if the access file I'm linking to is password protected?
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question