Access VBA to import alltables from another database

Murray Brown
Murray Brown used Ask the Experts™
on
What Access VBA code would I use to import all the tables that I created in another database into the current database with all the data unchanged
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dale FyeOwner, Dev-Soln LLC
Most Valuable Expert 2014
Top Expert 2010

Commented:
Why do you want to import it, rather than link it?

Are you going to do this on a regular basis?  If so, then code might be the way to go, but if it is a one time deal, I'd just use the  External Data link on the ribbon to do this.
Most Valuable Expert 2015
Distinguished Expert 2018
Commented:
Use the method here:

https://www.experts-exchange.com/questions/29162267/Access-VBA-Recreate-backend-database-with-relationships.html#a42967586

just move the dot for "Import tables" to: "Definition and data".
That will import the tables in the right order respecting referential integrity.
Murray BrownASP.net/VSTO Developer

Author

Commented:
Thanks
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
You are welcome!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial