且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在“仅添加”中打开表单模式

更新时间:2023-01-25 14:18:02

您好


您需要在关闭之前/期间从AddOnly表单中重新查询MainForm。这可以用这种语法完成


表格(MainFormName)。Requery


此代码可用于AfterUpdate,Unload或者关闭''AddOnly'表单的事件。


一个提示,如果''AddOnly''表单可以打开/使用''MainForm''关闭,那么在尝试Requery之前,你需要检查它是否打开,即

Hi

You need to requery the ''MainForm'' from the ''AddOnly'' form before/during closing it. This can be done with this syntax

Forms("MainFormName").Requery

This code can be used in the AfterUpdate, Unload or Close Event of the ''AddOnly'' form.

One tip, if the ''AddOnly'' form can be open/used with the ''MainForm'' closed, then you will need to check that it is open before trying to Requery, ie.

展开 | 选择 | Wrap | 行号


谢谢,迈克!这几乎就是整件事!但是,我确实有一个表单集合,我不知道如何遍历该集合以重新查询每个表单。


以下是填充该表单的代码集合:

Thanks, Mike! This is almost the entire thing! I do, however, have a Collection of Forms, and I don''t know how to iterate through that collection in order to requery each one.

Here is the code that populates the collection:

展开 | 选择 | Wrap | 行号


其他人对此迭代问题有任何想法吗?
Anyone else have any ideas about this iteration problem?