Help with RecordsetClone

D

Diarmuid

I'm having a problem using the RecordsetClone. The form is based on a
snapshot. The code below works fine unless I make a change to the data. If I
edit the record in frmTimePop, I get an error on rsClone.FindFirst stSearch
as follows
3420 Object invalid or no longer set.

Any ideas?
Thanks
Diarmuid


'************************************
Dim rsClone As DAO.Recordset

stDocName = "frmTimePop"
stSearch = "DetailID = " & Me.DetailID

DoCmd.OpenForm stDocName, , , , , acDialog, stOpenArgs

Me.Requery
Set rsClone = Me.RecordsetClone
rsClone.FindFirst stSearch

If rsClone.NoMatch Then
MsgBox "Problem finding record", vbCritical
Else
Me.Bookmark = rsClone.Bookmark
End If

rsClone.Close
 
T

TC

May or may not be the cause of your problem, but: you did not .Open
rsClone - you should not be .Clos'ing it!

HTH,
TC
 
Y

Yuan Shao

Hi Diarmuid,

I learned if you edit the record in frmTimePop, you got an error "3420
Object invalid or no longer set." I also tried some tests using the codes
you provided, however, it seems the same error did not recur. Can you
please describe the relationship of the underlying tables of the related
form in detail? It might be helpful to solve this problem.

Please try to use Set rsClone = Me.Recordset.Clone instead of "Set rsClone
= Me.RecordsetClone", what's the result?

Also, if you can reproduce this problem, please provide a sample database
showing this problem so that I can perform further research.

I am looking forward to hearing from you soon.
Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

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