Question Append Problem

byTimber

Registered User.
Local time
Today, 04:56
Joined
Apr 14, 2012
Messages
97
Driving me mad!!

I select records from a table based on criteria:

< Dim rst As DAO.Recordset

Set rst = CurrentDb.OpenRecordset("SELECT * FROM [tblLVRWrittenStatements] WHERE [tblLVRWrittenStatements].[seedrsID] = " & seedrsIDVar & "") >

I now want to append these filtered records to another table called ArchivedWrittenStatementsTable;

< CurrentDb.Execute "INSERT INTO [ArchivedWrittenStatementsTable] SELECT * FROM rst" >

Would be lovely except rst not recognised.
Is there a way of achieving this without having to <addnew etc > looping through the records.

Would be most grateful for some help here....
 
Almost immediately found the answer, probably not the most elegant but ..

<CurrentDb.Execute "INSERT INTO [ArchivedWrittenStatementsTable] SELECT * FROM [tblLVRWrittenStatements] WHERE [tblLVRWrittenStatements].[seedrsID] = " & seedrsIDVar & "">

Hope this helps someone as useless as me!!
 

Users who are viewing this thread

Back
Top Bottom