Prompt user for table name in Make table query

ppete

Registered User.
Local time
Today, 12:09
Joined
Jan 15, 2002
Messages
27
Is there a way to prompt the user for the name of the table to be created in a make table query?

TIA,

Pete
 
I found the solution and it's quite simple.
I took the sql from the query and added it to the VBA code behind a command button:

Here goes:

DTable = InputBox("Please enter a name for the output table", "?")

mysql = "SELECT table1.Field1 AS F1, table1.Field2 AS F2, table.Field3 AS F3 etc… INTO " & DTable & " FROM table1 GROUP BY table1.Field1;"
DoCmd.RunSQL mysql

laterz,
P
 

Users who are viewing this thread

Back
Top Bottom