将表单引用传递给表单... [英] Pass a form reference to a form...

查看:97
本文介绍了将表单引用传递给表单...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个复杂的...


我有一个模态表单,允许用户预览一些文本,然后单击提交或关闭。这个表单是从其他几种形式调用的。


我想要什么,因为Access不能从表单返回值,是设置(从模态表单)隐藏调用表单上的复选框,它会显示用户在模态表单上按下的按钮。


我的问题是这样的 - 如何传递调用表单的名称(可能是对于模态形式是一个子表单,所以我可以在调用表单上设置复选框。


我想只是传递Me.Name,然后以模态形式,使用Forms(Me.OpenArgs).chkRetval ...但是从子窗体调用时,失败了。我还考虑在模态形式上设置一个标志,隐藏它,从调用表单中读取标志然后关闭模态形式,但这看起来很混乱,所以它是最后的手段。


有什么想法吗?


谢谢

This is a complicated one...

I have a modal form that lets the user preview some text, then either click Submit or Close. This form is called from several other forms.

What I would like, since Access can''t return a value from a form, is to set (from the modal form) a hidden checkbox on the calling form, which would show which button the user pressed on the modal form.

My problem is this -- how can I pass the name of the calling form (which may be a subform) to the modal form, so I can set the checkbox on the calling form.

I''ve thought to just pass Me.Name, and then in the modal form, using Forms(Me.OpenArgs).chkRetval... but when calling from a subform, that fails. I''ve also considered setting a flag on the modal form, hiding it, reading the flag from the calling form and then closing the modal form, but that seems messy, so it''s a last resort.

Any thoughts?

Thanks

推荐答案

我有点困惑,为什么你需要捕获哪个按钮被点击了?为什么不将相关代码添加到按钮的onclick而不是执行其他表单模块的操作?
I''m a little confused as why you would need to capture which button has been clicked? Why not just add the relevant code to the onclick of the button rather than perform the actions from another forms module?



I''ma有点困惑,为什么你需要捕获哪个按钮被点击?为什么不将相关代码添加到按钮的onclick而不是从其他表单模块执行操作?
I''m a little confused as why you would need to capture which button has been clicked? Why not just add the relevant code to the onclick of the button rather than perform the actions from another forms module?



此表单允许用户在将文本写入另一个数据库之前预览一些文本。我需要知道用户是否发布了文本或关闭了表单而没有发布。基于此,呼叫表格将更新发布日期。或不。如果调用表单负责编写该日期而不是模式表单,那么它会更清晰,因为发布的日期并不总是在同一个表中。

This form allows the user to preview some text before writing it out to another database. I need to know if the user published the text or closed the form without publishing. Based on that, the calling form will either update a "published date" or not. It''s a lot cleaner if the calling form takes care of writing that date, instead of the modal form because the published date will not always be in the same table.


消息怎么样带有是或否按钮的框。您可以捕获按下的按钮并采取相应的行动。
What about a message box with a yes or no button. You can capture which button is pressed and act accordingly.


这篇关于将表单引用传递给表单...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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