Solved

Access 2007 VBA - Relink database tables from code

Posted on 2011-02-16
2
1,387 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

690 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