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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copying records 1

Status
Not open for further replies.

Joshy

Programmer
Mar 8, 2001
14
CA
I'm trying to copy the first 24 records from one tbl to another and using the latter to generate a report. Currently the 2nd tbl has no records. Both tbl contain the same columns headings.

Set db = currentDB()
Set rec = db.OpenRecordSet("tblToBeCopied")
Set rec2 = db.OpenRecordSet("tblSecondCopy")

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

But at the end nothing was copied over, am I missing something?
any help would be appreciated.
Josh
 
Do you need to do this in code? Why not:

INSERT INTO NewTable
SELECT TOP 24 *
FROM OldTable
WHERE ;

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