Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh a link to a table in another database

Status
Not open for further replies.

ApparentlyInept

Technical User
Mar 13, 2005
25
US
Ok...here's my problem. I have a series of forms created in a file that all point to a table in another database. As such I linked that table to the current file. Problem is whenever the users go to open the file on a new system it says that the linked table couldn't be found so I have to open it up on that system delete the link and recreate it for everything to work. Is there a way to put a code in the OnOpen event procedure on my main form that will either refresh this link or delete it then link it again?

Database linked to: Master List (Table: Overall List)
Forms in current file: Main, Name, Inprocess, Update

Thx
The Inept One
 
As long as you dont have to enter a password to access the db the 'real' tables are in when you perform the procedure manually, you can delete the tables using vba code and re-link using the TransferDatabase method.

You can do both using a simple macro or use vba.

If the db is password protected, i'd like to know how to do it. All the specimen code ive seen is rather lengthy but I understand a better method than using TransferDatabase.
 
No password so sorry to not be able to help you out there but would you know what the code to delete the linked table would be?

Inept
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top