从表单到子表单的阅读 [英] Reading from form to subform
问题描述
嗨!
我的表单中有一个列表框,其中包含查询值。
I have a form with a listbox which has values from a query.
然后,我有一个子表单,我想在其中显示从表单中的列表框中选择的值。但我不知道怎么办?
Then, I have a subform in which I would like to display the value selected from the listbox in the form. But I don't know how?
我试过:
subform.textbox.text = [form]!list22.value(我也有尝试过itemdata和itemselected但也没有工作)
subform.textbox.text = [form]!list22.value (I have also tried itemdata and itemselected but didn't work either)
任何人都可以帮忙吗?
推荐答案
使用列表框的AfterUpdate事件。
Use the listbox's AfterUpdate event.
Me.mySubForm.Controls("mytextbox") = Me.myListbox
但是我觉得你有一个值在您的主表单上,您要复制到您的子。通常,您不希望一个表中的数据依赖于另一个表中的数据。你能解释一下你想要见面的要求吗?
But it bothers me that you have a value on your main form that you are copying to your sub. Normally, you don't want data in one table that is dependent on the data in another table. Can you explain the requirement that you are trying to meet?
这篇关于从表单到子表单的阅读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!