I have been trouble with a function that i coded to requery a subform and keeping the same record position.
My function is as follows:
Now. on the line where it says "frm.Form.bookmark = frm.Form.RecordsetClone.bookmark" it generates the error 2001 which is the canceled previous operation error.
If i hit debug and then just resume the code it works.
Also, something interesting i figured out is that if i put just a blank messagebox before setting the bookmark then everything works out.
Any ideas or help would be lovely!
Thanks
My function is as follows:
Code:
Public Function Search_AND_Requery(search As String, frm As subform, nPK As Integer)
frm.Requery
With frm.Form.RecordsetClone
.FindFirst search & " = " & nPK
If Not .NoMatch Then
frm.Form.bookmark = frm.Form.RecordsetClone.bookmark
End If
End With
End Function
Now. on the line where it says "frm.Form.bookmark = frm.Form.RecordsetClone.bookmark" it generates the error 2001 which is the canceled previous operation error.
If i hit debug and then just resume the code it works.
Also, something interesting i figured out is that if i put just a blank messagebox before setting the bookmark then everything works out.
Any ideas or help would be lovely!
Thanks