CreateTableDef based on existing table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using Access 2000, is there way of programmatically creating a new tabledef;
based on the field types of an existing table? I want to create four new
tables in code, all identical in structure to an existing table, but think
there must be an easier way than setting each of the field types for each of
the tables in code when they're all the same anyway.

Thanks.
 
Maybe: SELECT * FROM OldTable INTO NewTable WHERE False

or somesuch.

PS. There are few if any situations where you would create duplicate
table structures, in a properly designed database. Why are you actually
trying to do that?

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
Thanks! I found that if I use docmd.transferdatabase, I have the option of
creating a duplicate database without the data, just the structure, and the
field sizes and field types come across correctly.

To answer your question, it's not actually a database, just an application
that pulls in some Excel spreadsheets to Access, filters, manipulates and
sorts the data and returns them to Excel.
 
Back
Top