Code to duplicate tables

J

jnew

Greetings,

Is there a way to programmatically create copies of all
user-created tables in one database into another?

I have created Make-Table queries for each table and run
them as a group using a macro. It works well enough, but
requires me to remember to create a new query and add it
to the macro each time a new table is created. Of course,
there are the similar problems if a table is deleted.

I've tried to write a function that loops through each
TableDef in the CurrentDB's TableDefs collection, catch
each TableDef.Name that is not like "MSys*", and run SQL
to create the duplicate table. It's not working. Any
direction will be greatly appreciated.

jn
 
L

Lance McGonigal

I've used the docmd.transfer method. Basically I have a button on a form
that does the following:

1. Creates a blank access database
2. Loops through the table collection executing the transfer table method

Hope it helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top