Loading a table with the results of a query

ballboy

New member
Local time
Today, 22:51
Joined
Jul 23, 2008
Messages
3
Hi all,

I need a bit of help so thought I would submit a post.

I am trying to load a table through a VBA process with the results displayed in another query.

eg
qryResults has the following columns: ID, DATE, COMMENTS
tblEmpty has the following columns: ID, DATE, COMMENTS

I want to use VBA code to load all records from qryResults into tblEmpty (already created and currently empty).

Does anyone know how to do this?

Thanks
 
cant you just turn that query into an update or insert query that will do exactly what you are trying to do?
 
With very few exceptions, a query can be used in place of a table - and often SHOULD be so used. You are inviting a divergence of data. I can only think of one time where you would do this - where you were about to ship out some data and wanted it in a separate table to know what you shipped. In which case you would time-tag the new records in that table and let the records represent a history of what was sent.

In any other case that isn't somehow related to historical record-keeping, it is not merely unnecessary to write that record to a table, it might even actually be WRONG to do so, from a data purist standpoint.
 
Code:
SELECT ID, DATE, COMMENTS
INTO MyTable_backup
FROM MyTable
WHERE ID = Blah

Regards,
Tim
 

Users who are viewing this thread

Back
Top Bottom