Adding to a recordset

J

James

I'm trying to run through a recordset (rs) and create a new one
(OfferingsDuplicate) off of that one. It errors out on the .AddNew with
error "Operation is not allowed when the object is closed"

Here's my code:

Set DuplicateOfferings = New Recordset
Do While Not rs.EOF

If Not IsNull(rs.Fields("Link")) Then
If rs.Fields("Link") <> "" Then
If rs.Fields("Link") <> 0 Then

DO_Link = rs.Fields("Link")

With DuplicateOfferings
.AddNew (DO_Link)
.update
End With

DO_OfferingID = rs.Fields("OfferingID")

With DuplicateOfferings
.AddNew (DO_OfferingID)
.update
End With


End If
End If
End If


rs.MoveNext
Loop


Thanks!
 
J

James

My recordset has no fields in it.... how do I add a field "Parent" and
"Child" and then add data to those fields? Sorry I don't really know
what I'm doing. Thanks a lot!
 
J

James

never mind... i'm gonna try it a different way.
James said:
My recordset has no fields in it.... how do I add a field "Parent" and
"Child" and then add data to those fields? Sorry I don't really know
what I'm doing. Thanks a lot!
 

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