I have a parent form with a record set (RS1) that results from a users search.
As each record can have children they are shown in a subform, but are not always part of the search results and thus the record set (RS1).
I have just tested copying (RS1) with Me.RecordSet.Clone to a form level DAO Recordset object. eg Set currentFormRecordSet = Me.RecordSet.Clone
Then letting the parent form have a new RecordSource string to show the single record from the subform.
To go back to the (RS1) and current record I am setting Me.RecordSet to the form level variable. eg Set Me.RecordSet = currentFormRecordSet
It seems to work, including showing the current record which was being viewed before leaving it and in the same order.
I am wondering if this is ok. Are there any repercussions of doing this? Or anything I am not thinking about.
As each record can have children they are shown in a subform, but are not always part of the search results and thus the record set (RS1).
I have just tested copying (RS1) with Me.RecordSet.Clone to a form level DAO Recordset object. eg Set currentFormRecordSet = Me.RecordSet.Clone
Then letting the parent form have a new RecordSource string to show the single record from the subform.
To go back to the (RS1) and current record I am setting Me.RecordSet to the form level variable. eg Set Me.RecordSet = currentFormRecordSet
It seems to work, including showing the current record which was being viewed before leaving it and in the same order.
I am wondering if this is ok. Are there any repercussions of doing this? Or anything I am not thinking about.
Last edited: