How to duplicate one record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am in need to create a new record in the same table with information from
an existing record. Since I have a lot of fields in that table, I want to
know if exist one method that let me create the copy without creating
variables for each field for posterior dumping in the new record.
 
something like this:

dim fld as field, rst as recordset, rst2 as recordset,

open rst, rst2

rst2.add new
for each fld in rst.feilds
rst2(fld.name)=rst(fld.name)
next fld
rst2.update

of course you have to handle primary keys also

HTH
 
Back
Top