MakeTable

  • Thread starter Thread starter Craig
  • Start date Start date
C

Craig

Is there any way to simulate a make-table query using VBA
code?

Furthermore, is there any way to delete an entire table
from existence using VBA code?

If anyone knows the syntax for something like that, please
share. thank you...

Craig
(e-mail address removed)
 
Use the TableDefs collection

There is sample code in help to create a table and delete
one.
 
In addition of what Media Lint says, here is a sample using DDL:

' creating a new table
Sub CreateNewTable()
Dim strSQL As String

strSQL = "CREATE TABLE MyTable " _
& "(fld1 INTEGER, fld2 TEXT)"

CurrentDb.Execute strSQL

End Sub

' deleting a table
Sub DropTable()
Dim strSQL As String

strSQL = "DROP TABLE MyTable"

CurrentDb.Execute strSQL

End Sub

HTH

--
Saludos desde Barcelona
Juan M. Afan de Ribera
<MVP Ms Access>
http://www.juanmafan.tk
http://www.clikear.com/webs4/juanmafan
 
Back
Top