Copy structure table

B

BB

is it possible to copy or duplicate the structure of a table, with no data
inside?


Thanks
BB
 
D

Dennis

Right click on the table name and click copy. Right click in the database
window and click paste. You will then get a box to enter the table name with
options to just copy structure or structure and data.
 
B

BB

I should do it in a VBA function

BB

Dennis said:
Right click on the table name and click copy. Right click in the database
window and click paste. You will then get a box to enter the table name with
options to just copy structure or structure and data.
 
D

Dennis

DoCmd.CopyObject, "Original Table", acTable, "New Table"
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [New Table]"
DoCmd.SetWarnings True
 
B

BB

Sorry, maybe I didn't explained properly the matter:

DoCmd.CopyObject copies structure and data, I need only the structure.
Thanks
BB

Dennis said:
DoCmd.CopyObject, "Original Table", acTable, "New Table"
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [New Table]"
DoCmd.SetWarnings True


BB said:
I should do it in a VBA function

BB

name
with no
data
 
D

Dennis

Yes I know, that is why I gave you the other lines of code including the
'DELETE * FROM the New table' after you have copied it.

BB said:
Sorry, maybe I didn't explained properly the matter:

DoCmd.CopyObject copies structure and data, I need only the structure.
Thanks
BB

Dennis said:
DoCmd.CopyObject, "Original Table", acTable, "New Table"
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [New Table]"
DoCmd.SetWarnings True


BB said:
I should do it in a VBA function

BB

"Dennis" <[email protected]> ha scritto nel messaggio
Right click on the table name and click copy. Right click in the database
window and click paste. You will then get a box to enter the table name
with
options to just copy structure or structure and data.

:

is it possible to copy or duplicate the structure of a table, with no
data
inside?


Thanks
BB
 
D

Dirk Goldgar

BB said:
I should do it in a VBA function

DoCmd.TransferDatabase _
acImport, _
"Microsoft Access" , _
CurrentDb.Name, _
acTable, _
"OriginalTable", _
"CopiedTable", _
True
 
Top