从SubForm数据刷新表单 [英] Refreshing Form from SubForm data

查看:103
本文介绍了从SubForm数据刷新表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个使用NotInList函数弹出的子窗体。但在我输入信息并添加记录并关闭我的SubForm后,我的MainForm不刷新,除非我关闭它。


我的问题是如何在输入SubForm信息之后刷新它,当它刷新时它将自动填充我的MainForm中的框?

I created a Subform that pops open by using the NotInList Function. but after I enter the information and add the record and close my SubForm my MainForm does not refresh unless I close it.

My question is how can I make it refresh after I have entered in the SubForm information and also when it refreshes it will auto populate the boxes in my MainForm??

推荐答案

子表单是嵌入到另一个主表单中的表单。既然你在谈论打开和关闭它,我猜你不是指一个子表格。如果使用acdialog属性打开子窗体,主窗体中的代码将被暂停。直到你关闭子表格。所以在打开子窗体之后,只需添加一行说明重新查询有问题的组合框。


然后,您可以使用公共变量来保存新添加的记录的密钥,并且然后通过代码选择它。


如果您需要更具体的说明,请告诉我们。
A subform is a form embedded into another main form. Since your talking about opening and closing it, im guessing you don''t mean a subform. If you open the subform with the acdialog property, the code in your main form will be "paused" until you close the subform. So after the line opening the subform, just add a line saying to requery the combobox in question.

You can then use a public variable to hold the key of hte newly added record, and then select it via code.

If you need more specific instructions, let us know.


@TheSmileyOne


感谢您的回复TheSmileyOne,


后来我意识到我实际上并没有做一个subForm。我只是拥有它,所以在你希望添加一些东西到列表之后打开一个单独的表格。因此,我需要知道如何使我的主表单刷新或重新查询已添加到表中的信息。我已经将它设置为从查询中提取,所以我应该在关闭表单后添加一些内容,因为您说要更新?


一些例子会很棒!


感谢帮助。
@TheSmileyOne
Thanks for the reply TheSmileyOne,

Later on I realized that i am not actually doing a subForm. I just have it so a seperate Form opens up after you wish to add something to the list. So I need to know how to make my main form refresh or re-query the information that has been added to the table its pulling from. I already have it set up to pull from a query so should I just add something in to each box as you said to update after you close the form?

Some examples would be great!

Appreciate the help.


hi,

你可以使用AfterUpdate事件我假设组合框的名称controll是customer_id

you can use the AfterUpdate event I assumed the name of the combobox controll is customer_id
展开 | 选择 | Wrap | 行号


这篇关于从SubForm数据刷新表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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