How to duplicate one record

U

Ultrataga

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.
 
A

Alex Dybenko

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top