Automatically re-link tables in a back-end file (1 Viewer)

josephbupe

Registered User.
Local time
Today, 08:27
Joined
Jan 31, 2008
Messages
247
Hello,

I am looking for a code to automatically re-link ms access tables. My front-end and back-end are both in the same folder, but the folder location ma changing machine locations. Google search found me this link links http://allenbrowne.com/ser-13.html but it's for old versions of ms access and I am using ms access 2016.

I will appreciate it.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:27
Joined
May 7, 2009
Messages
16,875
you need to put a Static IP for your BE, so you don't everytime relink your tables.
 

josephbupe

Registered User.
Local time
Today, 08:27
Joined
Jan 31, 2008
Messages
247
you need to put a Static IP for your BE, so you don't everytime relink your tables.
The folder contaning my BE and FE is on a movable drive which I carry along with me.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:27
Joined
May 7, 2009
Messages
16,875
actually, sometime ago, a friend ask me to do the same as you have.
what i did is on Opening the FE, a frmSetUpDrive will open (after the welcome screen).
then you can select which Drive to use.

Note that the BE is in "fixed" location and only the drive changes.
after you select the "new" drive, it will Relink all your table.
 

Attachments

  • dbChangeBEPath.accdb
    640 KB · Views: 145

josephbupe

Registered User.
Local time
Today, 08:27
Joined
Jan 31, 2008
Messages
247
actually, sometime ago, a friend ask me to do the same as you have.
what i did is on Opening the FE, a frmSetUpDrive will open (after the welcome screen).
then you can select which Drive to use.

Note that the BE is in "fixed" location and only the drive changes.
after you select the "new" drive, it will Relink all your table.
Thanks for sharing. In fact there is also this other code I found, which who suit my scenario, unfortunately it's giving some errors. I hope someone can update it: https://accessdeveloper.net/relinking-back-end-to-front-end-database-automatically-using-vba-code/
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 01:27
Joined
Feb 19, 2002
Messages
36,961
Did you try Allen's code? I didn't see anything that referred specifically to ".mdb". If I missed something, just change the reference to ".accdb". VBA from A97 will still work in current versions of Access. VBA from today will work in A97 unless you used some new function like Split() that was added after 1997.

If you want help debugging the other code, you need to post YOUR implementation of it so we can be sure there are no typos AND you need to tell us what errors you are getting.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 22:27
Joined
Oct 29, 2018
Messages
19,201
Hi. Lots of options for you. Here's another one: J Street Access Relinker

 

josephbupe

Registered User.
Local time
Today, 08:27
Joined
Jan 31, 2008
Messages
247
Did you try Allen's code? I didn't see anything that referred specifically to ".mdb". If I missed something, just change the reference to ".accdb". VBA from A97 will still work in current versions of Access. VBA from today will work in A97 unless you used some new function like Split() that was added after 1997.

If you want help debugging the other code, you need to post YOUR implementation of it so we can be sure there are no typos AND you need to tell us what errors you are getting.
Indeed, Allen's code is super easy to implement. I followed your tips and achieved what I wanted.

Thank you so much to you all for the help.

Best regards.
 

MAAS8000

Registered User.
Local time
Yesterday, 22:27
Joined
Apr 3, 2018
Messages
38
try this
in the login form i made a button to open the linked table manager with this code

Private Sub Command52_Click()
RunCommand (acCmdLinkedTableManager)
End Sub
you can update the DB address first then make login
loginfrm.JPG
 

Users who are viewing this thread

Top Bottom