Solved

Access 2007 VBA - Relink database tables from code

Posted on 2011-02-16
2
1,370 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

856 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