编程改变子窗体属性的问题 [英] Problem with programatically changing subform properties

查看:50
本文介绍了编程改变子窗体属性的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个绑定到记录源的父表单,并且几个控件绑定到该记录源中的字段。还有一些未绑定的控件用于显示子表单中的各种数据。


设置为显示表单A。如果在列表A上进行选择,则在子表单控件中进行选择。 (未绑定)在父表单中。 形式A具有Query对象作为其记录源,该Query对象使用List A的值。类似地,如果用户点击列表B上的选择,则子表单控件的源对象将更改为表单B。以同样的方式。

例如,如果我手动将子表单的源对象设置为表单B,它将显示数据正常。但是当使用VBA以编程方式更改sourceobject时,查询将无法检索数据。


如果我清除了PARENT表单的记录源,那么它就像它应该是,但然后所有其他BOUND控件都不起作用。


我错过了什么吗?任何帮助深表感谢。谢谢。

I have a parent form bound to a recordsource and several controls are bound to fields in that recordsource. There are also several unbound controls that are used to display various data in a subform.

It''s setup to display "Form A" in the subform control if a selection is made on "List A" (unbound) in the parent form. "Form A" has as its recordsource a Query object which uses the value of "List A" as criteria.

Similarly, if the user clicks a selection on "List B", the subform control''s sourceobject changes to "Form B" in the same manner.

If I set the subform''s sourceobject manually to "Form B", for example, it will display the data fine. But when the sourceobject is being programatically changed using VBA, then the queries won''t retrieve the data.

If I clear out the PARENT form''s recordsource, then it works as it''s supposed to, but then all the other BOUND controls don''t work.

Am I missing something? Any help is much appreciated. Thank you.

推荐答案

嗨Postman,您可以回复一下目前正在使用的代码,以便我们查看它。


Don
Hi Postman, can you post back with the code that you are currently using so that we can take a look at it.

Don


正如唐所暗示的,如果不知道你拥有什么,就很难说出错了。


如果有帮助,请查看参考上的项目子表单
As Don implies, it''s hard to say what''s wrong without knowing what you have.

In case it helps, check out Referring to Items on a Sub-Form.


这是'单击父表单中的列表框时运行的代码。
Here''s the code that''s run when the listbox in the parent form is clicked.
展开 | 选择 | Wrap | 行号


这篇关于编程改变子窗体属性的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆