http://www.techonthenet.com/sql/tables/create_table2.php
I have a very complex query that pulls in information from ~10 tables, I’d like to then print those results to a table.
Here’s my attempt:
DoCmd.RunSQL "CREATE TABLE [DATA OUTPUT TABLE] AS (SELECT * FROM [Data Export]);"
Where [DATA OUTPUT TABLE] is intended as the new table name and [Data Export] is the name of the query.
Advertisement
Answer
Almost immediately found the answer: http://www.w3schools.com/sql/sql_select_into.asp
DoCmd.RunSQL "SELECT * INTO [DATA OUTPUT TABLE] FROM [Data Export];"