Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

clone record

Status
Not open for further replies.

Joshy

Programmer
Mar 8, 2001
14
0
0
CA
I'm trying to copy the first 12 records from one table to another table which I just created. But its not going through. The 2 tables have the same fields (except not in the same order) following is the code:

For intX = 1 To 24
Set rec2 = rec.Clone
rec.MoveNext
rec2.MoveNext
Next

where rec is the original tbl and rec2 is the new one.
where's the problem?
 
You need to look up the AddNew and the Save properties of a recordset. All you are doing now is looping through the records. You need to do something like the following:
Code:
For intX = 1 To 24
      rec2.Addnew
      Set rec2 = rec.Clone
      rec2.Save
      rec.MoveNext
      rec2.MoveNext
Next
I think that is close, but the help should have an example that you can get the final details from. Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top