在“数据表表单”视图中无法访问多个级别的子级/父级 [英] Can't access multiple levels of children/parents in Datasheet Form views
问题描述
我创建了与父/子相关的表单,这些表单有几个级别。当它们都处于窗体视图中时,我可以使用顶部窗体模块访问VBA中的最低窗体模块,从最低窗口模块可以引用顶层父窗口。但是当我将表格更改为数据表
View时,我失去了这个功能。例如,虽然所有都处于窗体视图中,但这有效,但DS视图中的所有窗体都不起作用:
$
Debug.Print Me.Parent.Form.Parent。 Form.Name
Debug.Print Me.child.Form.child.Form.Name
您好。我做了一些快速测试,我发现你是"必须"首先激活表单的子数据表控件,然后才能引用子属性。您在代码中使用了哪个事件?
I've created parent/child-related forms that go down a few levels. When they are all in form view, I can use the top form module to access the lowest form module in VBA and from lowest I can reference the top parent. But when I change the forms to Datasheet
View, I lost this functionality. For example while all are in Form view this works, but all forms in DS view this won't work:
Debug.Print Me.Parent.Form.Parent.Form.Name
Debug.Print Me.child.Form.child.Form.Name
Hi. I did some quick testing and what I found out was you "must" activate the subdatasheet control of the form first before you can refer to the child property. Which event were you using for your code?
这篇关于在“数据表表单”视图中无法访问多个级别的子级/父级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!