[英]MS Access VBA- Filter subform from another subform (within a navigation from of a main form)
I have an unbounded Form Called [frmTestsMain] which includes 3 subforms:我有一个名为 [frmTestsMain] 的无界表单,其中包括 3 个子表单:
What I want is:我想要的是:
I wrote the code like below and worked with no problems If I open the [frmTestsMain] directly.如果我直接打开 [frmTestsMain],我编写了如下代码并且没有问题。
Private Sub TestMGroup_Click()
Forms![frmTestsMain]![frmTSGroupList].Form.Filter = "TestMGroup =" & Me.ID
Forms![frmTestsMain]![frmTSGroupList].Form.FilterOn = True
End Sub
and和
Private Sub TestSGroup_Click()
Forms![frmTestsMain]![frmTestsList].Form.Filter = "TestSGroup =" & Me.ID
Forms![frmTestsMain]![frmTestsList].Form.FilterOn = True
End Sub
But when I included the [frmTestsMain] from in A navigation form with a min from , i get an error.但是,当我将 [frmTestsMain] from 包含在带有 min from 的导航表单中时,出现错误。
I tried to modify the code like the following but I get the same problem我试图修改如下代码,但我遇到了同样的问题
Private Sub TestMGroup_Click()
Forms![frmMain]![NaviTests]![frmTestsMain]![frmTSGroupList].Form.Filter = "TestMGroup =" & Me.ID
Forms![frmMain]![NaviTests]![frmTestsMain]![frmTSGroupList].Form.FilterOn = True
End Sub
Could you help me please.请问你能帮帮我吗。 Thanks
谢谢
I found the solutions, and thanks for all the people here and there who helped me to figure it out我找到了解决方案,感谢所有帮助我解决问题的人
Private Sub TestMGroup_Click()
Forms![frmMain]![NavigationSubform].Form![frmTSGroupList].Form.Filter = "TestMGroup =" & Me.ID
Forms![frmMain]![NavigationSubform].Form![frmTSGroupList].Form.FilterOn = True
End Sub
Thanks谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.