MakeTable

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)
 
M

Media Lint

Use the TableDefs collection

There is sample code in help to create a table and delete
one.
 
J

Juan M. Afan de Ribera

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
 

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

iterators (pointers) 5
VBA Date 1
nested while loops 1
make table query 1
delete table 2
ODBC 3
Dumping Query Contents To Excel File 2
Get records with a negative value anywhere in the table. 8

Top