Copy structure table

  • Thread starter Thread starter BB
  • Start date Start date
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.
 
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.
 
DoCmd.CopyObject, "Original Table", acTable, "New Table"
DoCmd.SetWarnings False
DoCmd.RunSQL "DELETE * FROM [New Table]"
DoCmd.SetWarnings True
 
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
 
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
 
BB said:
I should do it in a VBA function

DoCmd.TransferDatabase _
acImport, _
"Microsoft Access" , _
CurrentDb.Name, _
acTable, _
"OriginalTable", _
"CopiedTable", _
True
 
Hi,
Open your Access (a new Database)
clikc on file
mouse to : Get external data
then: import (click)
select the file that contains your table that you want to import the table
structure only.
Select your table

go to options and choose: Defenition only.
 

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

Similar Threads

Copying Database Structure 2
LINQ Help 0
copy table structure 10
Printing Structures 1
Export Access table structure in a Word table 8
Parsing a table 1
Copy table structure info 4
Help: Need to delete duplicates 3

Back
Top