将控制从子表单中的详细信息表单传递到主表单 [英] Pass Control from Details Form within Subform to Main Form

查看:82
本文介绍了将控制从子表单中的详细信息表单传递到主表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含客户信息的主表单。

I have a Main Form with Customer Information.

在主表单上我有一个子表单[OrderDescription_subfrm]被视为Continuous 带有一个显示Order#和一个TextBox,其中包含来自第二个表单的连接字符串[OrderDetails_frm]

On the Main Form I have a Subform [OrderDescription_subfrm] viewed as Continuous with a Button that displays the Order# and a TextBox that has a concatenation string from a 2nd Form [OrderDetails_frm]

John Smith客户#1

John Smith Customer#1

{Order1}  5-Hats; 6恤; 3-Sweatshirts

{Order1} 5-Hats; 6-Shirts; 3-Sweatshirts

{Order2} 10-Hats; 5恤; 1-Sweatshirt

{Order2} 10-Hats; 5-Shirts; 1-Sweatshirt

{NEW}

当我点击子窗体中的{Order1}按钮时,[OrderDetails_frm]会打开显示该订单的详细信息

When I click on the button {Order1} in the subform, the [OrderDetails_frm] opens to display the details of that order

订单1

帽子{5}

衬衫  {6}

Shirts {6}

运动衫{3}

我可以更改每个订单的金额,一切正常。  但是,当我点击{子窗体中的NEW}按钮,[OrderDetails_frm]打开,我输入每个项目的金额,但当我关闭[OrderDetails_frm]时,新订单
不会链接到主窗体。 我创建的新记录没有来自Customer_tbl的CustomerID。

I can change the amount for each order, and all works fine.  However, when I click the {NEW} button in the subform, the [OrderDetails_frm] opens, I enter the amounts of each item, but when I close the [OrderDetails_frm] the new order does not link to the Main Form.  I new record is created without the CustomerID from the Customer_tbl.

如何通过子表单将CustomerID传递到详细信息表单? 

How can I pass the CustomerID through the subform to the details form? 

推荐答案

您好,至少有两个选项:1。使用OpenArgs方法传递ID并将其分配给弹出窗口的Open事件中的外键表单,或2.设置弹出窗体的默认值,并引用主窗体希望它有帮助......
Hi, You have at least two options: 1. Pass the ID using the OpenArgs method and assign it to the foreign key in the Open event of the popup form, or 2. Set the default value of the popup form with a reference to the main form Hope it helps...


这篇关于将控制从子表单中的详细信息表单传递到主表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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