Appending in Code

  • Thread starter Thread starter mo
  • Start date Start date
M

mo

Hello all,

On closing a form I need to append all the records in one table to another
and delete them from the orginal table. I'm quite used to working with
recordsets and DAO, but have not used it in this way before.

Should I use the normal method with DAO, i.e. declaring a recordset
variable, specifying an SQL string, use rst.add and rst.update in a loop to
accompliish this task or is there a way in code to just run an append query.
Do I have to use Docmd.RunSQL?

TIA

Mo
 
Hi Mo,

You could use DoCmd.RunSQL or

Dim dbs As DAO.Database
dbs.Execute("INSERT INTO etc.")
dbs.Execute("DELETE * FROM MyTable")

Not much point in running throught a recordset when SQL can do it for you,

Cheers,
Peter
 
Back
Top