Avatar of Murray Brown
Murray Brown
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Access VBA move table and create link

In Accces I have a split database solution with forms in my front-end database and tables in the other. Is it possible to use VBA to copy a new table created in the front-end to the backend then delete it and link to the copied backend table. so I am effectively moving it from the one database to the other then creating a link to it
Microsoft AccessVBA

Avatar of undefined
Last Comment
Murray Brown

8/22/2022 - Mon
John Tsioumpris

If i am not mistaken the TransferDatabase should cover all your needs
Check the article from MS : https://docs.microsoft.com/en-us/office/vba/api/access.docmd.transferdatabase
Murray Brown

ASKER
Thanks John. Would you be able to elaborate. I get the linking part but what about the moving part? Thanks
Fabrice Lambert

Use the acImport option with the TransfertDatabase function to import (create copies) your tables.

Unless new table are created or table names are updated, links in the front-end can remain untouched.
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
John Tsioumpris

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dale Fye

Personally, I'm not sure I see the use case for this.  Wouldn't it just be easier to use the External Data feature to copy from the FE into the BE, and then use it again in the FE to link the table from the BE?


Murray Brown

ASKER
Hi Dale
I see your point but I am working with highly incapable people that won't follow instructions. My previous approach was to use a third database where they simply had to import the new table into the backend. They got that wrong so I automated the process, which required pasting the front end and third database with their new tables into a folder, which was still a tall ask
Dale Fye

Totally understand, Murray.  You have to love users!

Dale
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Murray Brown

ASKER
You do Dale. And this is their so called "head of IT"