Code for Creating Table

U

Url Ons

You can use the following SQL
dim dbs as database
set dbs = CurrentDb
dbs.execute "CREATE TABLE tblNameOtable(Name Text(25),
Address Text(30), SomeNum Number, DateOf Date);"

dbs.execute INSERT INTO tblNameOtable((Name Text(25),
Address Text(30), SomeNum Number, DateOf Date) Select
Field1, Field2, Field3, Field4 FROM tblImportedTable;"

Docmd.DeleteObject tblImprotedTable
dbs = nothing
RotsORuck
Url
 
S

Sandy

Many thanks!

-----Original Message-----
You can use the following SQL
dim dbs as database
set dbs = CurrentDb
dbs.execute "CREATE TABLE tblNameOtable(Name Text(25),
Address Text(30), SomeNum Number, DateOf Date);"

dbs.execute INSERT INTO tblNameOtable((Name Text(25),
Address Text(30), SomeNum Number, DateOf Date) Select
Field1, Field2, Field3, Field4 FROM tblImportedTable;"

Docmd.DeleteObject tblImprotedTable
dbs = nothing
RotsORuck
Url

.
 

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