By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,985 Members | 1,863 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,985 IT Pros & Developers. It's quick & easy.

Passing Record Set Reference from a form

P: n/a
I have a small search form that I generated for an application. It
works fairly well buy simply setting the recordset clone of the form
that called it, to the ID searched for in the search form.

However, the search form can be called from several different forms,
and I would like to be able to set the recordset clone to the form
which initiated the search. Does this make sense? In a late afternoon
'stroke of genius' I tried to just set rs = "Forms!" & me.openargs &
".Recordset.Clone", passing in the name of the originating form.

Of course, it didn't work. So how to I generate a clone of the
originating form's recordset? The 'single form' working code is below.

' Find the record that matches the control.
Dim rs As Object

Set rs = Forms!frmCLASSIFICATION_LOG.Recordset.Clone
Set rs = Me.OpenArgs
rs.Find "[PARID] = " & Me.PARID
If Not rs.EOF Then Forms!frmCLASSIFICATION_LOG.Bookmark =
rs.Bookmark
DoCmd.Close

TIA

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
untested...
private sub search(frm as form)
' Find the record that matches the control.
Dim rs As Object
Set rs = frm.Re*cordset.Clone
Set rs = Me.OpenArgs
rs.Find "[PARID] = " & Me.PARID
If Not rs.EOF Then frm.Bo*okmark = rs.Bookmark
DoCmd.Close
end sub

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.