Make Table Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to know if it is possible to have a make table create a diffrent
name for the table each time?
 
No. However, you can write VBA code to generate the table name and then
update the SQL of the query to use that new name.
 
You can do it by assigning a new name using RunSql

Dim NewTableName As String
NewTableName = "NewName"
Docmd.RunSql "SELECT TableName.* INTO " & NewTableName & " FROM TableName"
 
I would like to know if it is possible to have a make table create a diffrent
name for the table each time?

Only with VBA (see the other answers).

However...

it is VERY VERY rarely necessary to use MakeTable queries *at all*.

MakeTable queries which store data in the table name are (in my
exprience) *never* a good idea. Bear in mind that a Select Query (the
very SELECT query upon which you base the MakeTable query) can be used
as the source of a Report, a Form, an export... pretty much anything
you would do with a Table. You get exactly the same result, without
redundant data storage, without bloat, and without the poor
performance due to Access creating all the systems table entries,
indexes, etc. etc. on the new table.

What's the purpose of these tables?


John W. Vinson[MVP]
 
Back
Top