View Full Version : Inserting results of coded query into a query


Anauz
02-15-2001, 01:27 AM
Hi

I have coded a query in a button, but i can only see the results in the debug window. Is there a way i can insert the results into a table or a query?


Thanx in advance

Atomic Shrimp
02-19-2001, 08:15 AM
Presumably you've built some sort of SQL statement that you execute with the OnClick event of the button.

If this is the case, and you want the results in a table, you need to change the SQL action from SELECT to SELECT....INTO (change it from a select query to a make-table query), or to re-use the same table each time, run a delete query to clear the table, then an append query to fill it again(INSERT INTO....SELECT).

If your button is simply running a query that's saved in the 'queries' tab of your database, it's even simpler; you can change the query type in the query designer.

Hope this helps

Mike

Anauz
02-20-2001, 01:01 AM
It's not in a query...the code is in VBA in the click event of a button...there is embedded SQL in it. But i think you have given me the right idea, using insert. Thanx