Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create new table from existing query

Status
Not open for further replies.

JoshuaAnthony

Programmer
Dec 17, 2003
20
0
0
AU
How do I do this? I tried using CreateTableDef() but that didn't seem to work (table wasn't added to my list of tables), although it didn't raise any errors...

Thanks,

Joshua
 
Joshua,
You have to add at least one field to the new tabledef and then append the tdf to the database tabledefs.

Code:
Dim tdf As TableDef
Set tdf = CurrentDb.CreateTableDef("myTable")
tdf.Fields.Append tdf.CreateField("myField", dbText, 5)
CurrentDb.TableDefs.Append tdf

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top