Assign recordset to subform
Posted on 2007-09-29
I have main form M that includes subform S. S is linked to M through field F. That bound is defined in S properties window.
Each of M and S have no Sourdce defined because I want to assign them ADO recordsets
Each of M and S have an open event like this:
Private Sub Form_Open(Cancel As Integer)
Dim SQL As String
Dim rst As New ADODB.Recordset
SQL = "Select for that form"
rst.CursorLocation = adUseClient
rst.Open SQL, cnRech, adOpenKeyset, adLockOptimistic
Set Me.Recordset = rst
It works OK except for one thing:
-All recors of S as displayed for any record of M. So, the binding has no effect.
Anybody knows how to preserve the binding?