如何在对话框窗口关闭时更新Mainform上的文本框? [英] How do I update textbox on Mainform on close of dialog window?
问题描述
我正在使用Access 2013建设
我正在使用导航表格。
我的主要表格是frm_orders
- 它有字段(绑定)txtOrderTotal
我的子表单是frm_orderdetails
- 它有(未绑定)字段txtSubTotal
我的对话框表单添加项目到订单详细信息是frm_AddItem
- 它有cboProduct,txtUnitPrice,txtQty
目前工作 - 当我在我的弹出窗体中添加一个新项目并保存它将项目添加到子窗体并更改txtSubTotal
关闭frm_AddItem时我似乎无法做的就是来自子窗体的txtSubTotal并将其放在主窗体上的txtOrderTotal中。
我试过通过常规方法访问文本框!frm_order!txtOrderTotal和Me.txtOrderTotal但是vba只是通过摇摇晃晃地说它找不到领域。
是因为我使用的是导航表格。
I am building in Access 2013
I am using Navigation forms.
My main forms is frm_orders
- It has the field (bound) txtOrderTotal
My subform is frm_orderdetails
- It has the (unbound) field txtSubTotal
My dialog form to add items to order details is frm_AddItem
- It has cboProduct, txtUnitPrice, txtQty
Currently working - When I add a new item in my popup form and save it adds the item to the subform and changes the txtSubTotal
What I can''t seem to do on close of the frm_AddItem is take the txtSubTotal from the subform and place it in txtOrderTotal on the main form.
I''ve tried accessing the text box via normal method Forms!frm_order!txtOrderTotal and Me.txtOrderTotal but vba just throughs a wobbly saying it can''t find the field.
Is it because I am using Navigation forms.
推荐答案
1)为什么?
2)显示您正在使用的公式/代码。请使用 [Code /] 按钮进行格式化。
1) Why?
2) show the formula/code you are using. Please format using the [Code/] button.
我怀疑你需要告诉它重新查询。
I suspect you need to tell it to requery.
Neo很可能是正确的;但是,导航控件有一个不寻常的属性,我们需要看到引用公式/代码。
如果OP将搜索ZMBD和导航控制我之前已经介绍过...... http://bytes.com /topic/access/answer...ntrol-subforms 我发了两篇这样的帖子,涵盖了使用导航控件的基础知识。
Neo is more than likely correct; however, the navigation control has an unusual property and we need to see the refering formula/code.
If OP will search on ZMBD and "Navigation Control" I''ve covered this before... http://bytes.com/topic/access/answer...ntrol-subforms I''ve made two such posts that cover the basics of using the Navigation Control.
这篇关于如何在对话框窗口关闭时更新Mainform上的文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!