"SELECT Field1, Field2, Field3 INTO DestTableName FROM SourceTableOrQueryName;"
Example:
"SELECT OrderNo, OrderDate, CustID INTO tmpCustOrders FROM qryOrders;"
This is what the code would look like:
=====
Private Sub Whatever_Click()
Dim db as Database
Set db = Currentdb
db.Execute "SELECT OrderNo, OrderDate, CustID INTO tmpCustOrders FROM qryOrders;"
db.Close
End Sub
=====
This will create a new table called tmpCustOrders based on the qryOrders Query. You can make this SQL statement as complex as you would like by adding things like WHERE statements, or GROUP BY. Jim Lunde
compugeeks@hotmail.com
Custom Application Development
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.