Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag 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
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

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
Avatar of Murray Brown

ASKER

Thanks John. Would you be able to elaborate. I get the linking part but what about the moving part? Thanks
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.
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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?


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
Totally understand, Murray.  You have to love users!

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