用于批量输入数据的表单
我有一个名为交易条目的表格。我有一个名为“批次”的子表单。我希望能够在交易输入表单中输入日期,然后在子表单上输入多个项目,但让它始终更新交易输入表单中的日期。
基本上,它就像我在下面绘制的那样,并且会自动将每条记录的日期从父表单更新到子表单的日期字段。![alt text][1]
I have a form called Transaction Entry. I have a subform called Batches. I want to be able to enter a date in the Transaction Entry form, and then enter multiple items on the subform, but have it always update the date from Transaction Entry form.
Basically it would be like what I have drawn out below, and would update the date automatically from the parent from to the subform's date field for every record.![alt text][1]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根本不需要任何代码。可以使用 Link Child &链接子表单控件的主字段属性(注意:子表单控件,而不是包含的表单)就是为了这个目的。您可以引用控件的名称,而不仅仅是链接属性中的字段名称:
子字段使用主字段的内容填充。
There should be no need for any code at all. It is possible to use the Link Child & Link Master Fields properties of the subform control (note: the subform control, not the form contained) for just this purpose. You can refer to the name of a control, not just field names in the link properties:
Child fields are populated with the contents of the master fields.
您可以做的最简单的事情(如果您知道子表单永远不会在其他地方使用)是添加“BeforeInsert”事件,然后引用父表单
您也可以在不提及表单名称的情况下引用父表单
The easiest thing you can do (if you know the subform will never be used anywhere else) is to add a "BeforeInsert" event and then reference the parent form
You could also reference the parent without mentioning the form's name