"Del" <(E-Mail Removed)> wrote in message
news:052D9C4B-E2A6-44D4-86F5-(E-Mail Removed)...
> I'm trying to create a second table in my DB with the same structure as an
> existing table but without the data. This code copies both the structure
> and
> the data.
>
> DoCmd.CopyObject , "Table2", acTable, "Table1"
>
> How can I copy just the structure?
If you want to do it manually, you can copy and paste, choosing "Structure
Only" when prompted. If you want to do it programmatically, you can use
TransferDatabase, specifying the current database as the target of an export
and giving True for the StructureOnly argument, like this:
Docmd.TransferDatabase acExport, "Microsoft Access", _
CurrentDb.Name, acTable, _
"Table1", "Table2", _
True
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)