?
Solved

Access 2007 VBA - Relink database tables from code

Posted on 2011-02-16
2
Medium Priority
?
1,390 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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

770 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