Code for Creating Table

  • Thread starter Thread starter Url Ons
  • Start date Start date
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
 
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

.
 
Back
Top