Relink Access tables from code (1 Viewer)

josephbupe

Registered User.
Local time
Today, 11:32
Joined
Jan 31, 2008
Messages
247
Hi,


Please, where can I find a working sample of how to re-link tables if the back-end has moved to a different directory either automatically or by asking the user to choose the new location for the back-end?


I have tried to find some but they don't work that way. The closest I think would be this one: http://access.mvps.org/access/tables/tbl0009.htm


But I that code behind a form bound to the back-end tables, and for a re-link test I moved the back-end to a new folder. The broken link did not re-link automatically.


Therefore, how should I proceed with this code?
 

June7

AWF VIP
Local time
Today, 00:32
Joined
Mar 9, 2014
Messages
5,470
Put the code behind unbound form or call it from an AutoExec macro.
 

josephbupe

Registered User.
Local time
Today, 11:32
Joined
Jan 31, 2008
Messages
247
Put the code behind unbound form or call it from an AutoExec macro.

Okay, I have done that. But when I move the back-end file from its usual place to another place, the code just pops up a message that the back-end file cant be found in that directory.

Next, I want to have an option to choose the back-end file myself through the open file dialog and I have no clue with all this stuff.

I have stripped the front end file and attached it here. Maybe some can take a look and advise.


I have include the table from the back-end file.


Thanx
 
Last edited:

Gasman

Enthusiastic Amateur
Local time
Today, 09:32
Joined
Sep 21, 2011
Messages
14,287
I have no clue with all this stuff.

Perhaps it might be advisable to try the link Catalina posted then. That has full Readme instructions and is probably set up as add and use?
 

josephbupe

Registered User.
Local time
Today, 11:32
Joined
Jan 31, 2008
Messages
247
Perhaps it might be advisable to try the link Catalina posted then. That has full Readme instructions and is probably set up as add and use?


Yes indeed, you are very right.


Please, I will be back if anything.


Cheers!
 

June7

AWF VIP
Local time
Today, 00:32
Joined
Mar 9, 2014
Messages
5,470
The mvps code you refetence is supposed to exactly what you want. Did you put code behind form or use AutoExec macro? If form, did you make unbound form the default when db opens?
 

Users who are viewing this thread

Top Bottom