Inserting results of coded query into a query (1 Viewer)

Anauz

Registered User.
Local time
Today, 14:44
Joined
Nov 14, 2000
Messages
81
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

Humanoid lifeform
Local time
Today, 14:44
Joined
Jun 16, 2000
Messages
1,954
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

Registered User.
Local time
Today, 14:44
Joined
Nov 14, 2000
Messages
81
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
 

Users who are viewing this thread

Top Bottom