如果表单未打开,请设置表单属性 [英] set Form properties if Form is not open

查看:97
本文介绍了如果表单未打开,请设置表单属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一些搜索,但是我的

问题无法得到明确的答案。所以这里是:如果我是一个开放形式(MyForm1),是否可以设置未打开表单(MyForm2)的RecordSource。我想要使​​用MyForm1的OnClose事件。
。但是当发生这种情况时,我不想让MyForm2打开。我希望它能够通过OnClose事件永久地改变MyForm2的

RecordSource

MyForm1。可以这样做吗?


感谢您的任何建议,Scott

I did a few searches, but couldn''t come up with a clear answer to my
question. So here it is: If I am in an open form (MyForm1), is it
possible to set the RecordSource of an un-opened form (MyForm2). I
want to use the OnClose Event of MyForm1. But I do not want to have
the MyForm2 open when this happens. My wish it to have the
RecordSource of MyForm2 permanently changed by the OnClose Event of
MyForm1. Can this be done ?

Thanks for any suggestions, Scott

推荐答案

ko ****** @ yahoo.com 写道:
ko******@yahoo.com wrote:
我做了一个很少搜索,但无法对我的问题提出明确的答案。所以这里是:如果我是一个开放形式(MyForm1),是否可以设置未打开表单(MyForm2)的RecordSource。我想要使​​用MyForm1的OnClose事件。但是,当发生这种情况时,我不想让MyForm2打开。我希望通过MyForm1的OnClose事件永久改变MyForm2的RecordSource。可以这样做吗?

感谢您的任何建议,Scott
I did a few searches, but couldn''t come up with a clear answer to my
question. So here it is: If I am in an open form (MyForm1), is it
possible to set the RecordSource of an un-opened form (MyForm2). I
want to use the OnClose Event of MyForm1. But I do not want to have
the MyForm2 open when this happens. My wish it to have the
RecordSource of MyForm2 permanently changed by the OnClose Event of
MyForm1. Can this be done ?

Thanks for any suggestions, Scott



有两种选择。


Docmd。 OpenformFormName

Forms!FormName.Form.Recordsource = what


您也可以在设计模式下打开表单,隐藏。修改

记录源,然后关闭/保存它。然后打开它。


A couple of options.

Docmd.Openform "FormName"
Forms!FormName.Form.Recordsource = whatever

You could also open the form in design mode, hidden. Modify the
recordsource, and close/save it. Then open it.


< ko ****** @ yahoo.com>在消息中写道

news:11 ********************** @ g10g2000cwb.googlegr oups.com ...
<ko******@yahoo.com> wrote in message
news:11**********************@g10g2000cwb.googlegr oups.com...
我做了一些搜索,但无法对我的问题提出明确答案。所以这里是:如果我是一个开放形式(MyForm1),是否可以设置未打开表单(MyForm2)的RecordSource。我想要使​​用MyForm1的OnClose事件。但是,当发生这种情况时,我不想让MyForm2打开。我希望通过MyForm1的OnClose事件永久改变MyForm2的RecordSource。可以这样做吗?

感谢您的任何建议,Scott
I did a few searches, but couldn''t come up with a clear answer to my
question. So here it is: If I am in an open form (MyForm1), is it
possible to set the RecordSource of an un-opened form (MyForm2). I
want to use the OnClose Event of MyForm1. But I do not want to have
the MyForm2 open when this happens. My wish it to have the
RecordSource of MyForm2 permanently changed by the OnClose Event of
MyForm1. Can this be done ?

Thanks for any suggestions, Scott



我不会通过改变设计视图来做到这一点。我会将此字符串

存储为某种形式的设置 - 可能在设置表中,或者可能作为

数据库属性甚至是注册表项。然后每次打开表单,

它会查找它的值并相应地设置记录源。

对于最终用户,这看起来像设计每次关闭

表单时都会更改,它只会以不同的方式实现。


I would not do this by altering the design view. I would store this string
as some form of setting - perhaps in a settings table or perhaps as a
database property or even a registry entry. Then each time the form opened,
it would look up it''s value and set the recordsource accordingly.
To the end user, this would look like the design had changed each time the
form was closed, it would just be implemented differently.


哇!那很快。谢谢,我会试试。 ~Scott

Wow ! That was quick. Thanks, I will try that. ~Scott


这篇关于如果表单未打开,请设置表单属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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