Populating a table based on query

BlueJacket

Registered User.
Local time
Today, 16:40
Joined
Jan 11, 2017
Messages
90
So, because I can't seem to get Word Merge to work on a query with parameters, I want to be able to run the query I need (with parameters) and then temporarily store that data in a table for me to base the Word Merge off of.

So, In VBA, I want to set a button to run a query and then enter the results of that query into an already made table. What would that code look like?

What code would I need to clear the contents of the tables (probably on an On Change or On Close event in a form)?

Thanks in advance.
 
CurrentDb.Execute "DELETE * FROM TableName"

will empty the table. You can use either of these to execute a saved query. The Execute method probably won't work if there are form parameters:

CurrentDb.Execute "QueryName"
DoCmd.OpenQuery "QueryName"
 

Users who are viewing this thread

Back
Top Bottom