从主表单2中检测子表单事件 [英] Detecting a Sub-Form event from the Main Form 2

查看:39
本文介绍了从主表单2中检测子表单事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一种从长医学文档输入数据的方法,使用结构:Mainform(subform1,... subfromN)。这反映了数据的逻辑模型:Document(section1,section2,... sectionN)。


MainForm只有一个控件,subfrom,详细信息,连续显示section1,... sectionN。这是通过按钮下一步完成的。和前一个位于MainForm的页脚。


我很满意这个设计:子形式,可能有数百个''没有类模块,因此节省了内存并使设计更简单。

在数据输入人声称之前,如果在填写一个部分后,另一部分自动进入,而不按下一步,则会更舒服。


所以到目前为止,我无法找到解决这一挑战的方案,即保持没有类模块的子模型并且捕获填充子表单的结尾。来自MainForm。


任何提示。

I have developed a way to enter the data from long medical document, using structure: Mainform (subform1,... subfromN). This is reflecting the logical model of data: Document(section1,section2,...sectionN).

The MainForm has only one control, subfrom, in Detail which displays consecutively section1,...sectionN. This is done by buttons "Next" and "Previous" located in MainForm''s Footer.

I was quite happy with this design: subforms, which could be of hundreds'' did not have class modules, thus saving memory and making design simpler.

Until data entering person claims, that it would be more comfortable if after one section is filled, the other is coming automatically, without pressing "Next".

So far I couldn''t find a solution for this challenge, i.e. keeping subforms without class modules and fishing up "end of filling the subform" from the MainForm.

Any hints.

推荐答案

你的下一步中的代码是什么?按钮?只是为了弄清楚你在做什么。
What''s the code in your "Next" button? Just to get an idea of what you''re doing exactly.


那里很简单,在课堂模块中


Private Sub NextForm_Click( )

调用NextPriv(Me.Name,1)

结束子


NextPriv确定哪个部分是包含在子表单中。

例如,主表单F02和部分表单F02001 - F02005

F02005的下一步是保存记录并关闭F02。对于所有其他表格,

确定为nextFrm并按声明更改设置


表格(pubLFrmName).FormSec.SourceObject = nextFrm


这会导致主窗体更改子窗体内容。
It is very simple there, in class module

Private Sub NextForm_Click()
Call NextPriv(Me.Name, 1)
End Sub


NextPriv is determining which section is to include in subform.
For example, there is main form F02 and section forms F02001 - F02005
Next for F02005 is saving records and close F02. For all other the next Form is
determined as nextFrm and changes settings by statement

Forms(pubLFrmName).FormSec.SourceObject = nextFrm

This causes main form change the subform contents.


在这种情况下,为什么在最后一个字段更新后没有子窗体

调用NextPriv(Me.Parent.Name,1)< - 虽然我不确定1是什么
In that case, why not have your subform after the last field is updated
Call NextPriv(Me.Parent.Name, 1) <- Though I''m not sure what the 1 is for


这篇关于从主表单2中检测子表单事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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