title: MS Access VBA- Filter subform from another subform (within a navigation from of a main form)
body: <p>I have an unbounded Form Called [frmTestsMain] which includes 3 subforms:</p>
  
  <ol>
  <li>[frmTestsList]</li>
  <li>[frmTMGroupList]</li>
  <li>[frmTSGroupList]</li>
  </ol>
  
  <hr>
  
  <ul>
  <li>[frmTMGroup] has a filed "TMGroup",</li>
  <li>[frmTSGroup] has a filed called "TSGroup"  and another lookup filed
  "TMGroup" linked to [frmTMGroup].TMGroup.</li>
  <li>[frmTestsList] has lookup filed "TSGroup" linked to [frmTSGroup].TSGroup.</li>
  </ul>
  
  <hr>
  
  <p>What I want is: </p>
  
  <ol>
  <li>When I click  [frmTMGroup].TMGroup, the other subform [frmTSGroup] to be filtered to get only TMGroup clicked.</li>
  <li>When I click [frmTSGroup].TSGroup, the other subform [frmTestsList] to be filtered to get only TSGroup clicked.</li>
  </ol>
  
  <p>I wrote the code like below and worked with no problems If I open the [frmTestsMain] directly.</p>
  
  <pre><code>Private Sub TestMGroup_Click()
  Forms![frmTestsMain]![frmTSGroupList].Form.Filter = "TestMGroup =" &amp; Me.ID
  
  Forms![frmTestsMain]![frmTSGroupList].Form.FilterOn = True 
   End Sub
  </code></pre>
  
  <p>and </p>
  
  <pre><code> Private Sub TestSGroup_Click()
   Forms![frmTestsMain]![frmTestsList].Form.Filter = "TestSGroup =" &amp; Me.ID
   Forms![frmTestsMain]![frmTestsList].Form.FilterOn = True
   End Sub
  </code></pre>
  
  <p>But when I included the [frmTestsMain] from in A navigation form with a min from , i get an error.</p>
  
  <p>I tried to modify the code like the following but I get the same problem</p>
  
  <pre><code>Private Sub TestMGroup_Click()
  Forms![frmMain]![NaviTests]![frmTestsMain]![frmTSGroupList].Form.Filter = "TestMGroup =" &amp; Me.ID
  
  Forms![frmMain]![NaviTests]![frmTestsMain]![frmTSGroupList].Form.FilterOn = True 
   End Sub
  </code></pre>
  
  <p>Could you help me please. 
  Thanks</p>