表格问题 - 如何避免太多! [英] Form Question - How to Avoid Too Many!

查看:58
本文介绍了表格问题 - 如何避免太多!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个数据库,我有一个表单可以添加一个新记录,一个表单

来编辑现有记录。我使用大部分

时间的未绑定表单和类模块。


我想要做的是有一个表单来处理添加新记录

到数据库并编辑相同类型的记录。在加载事件中将更改表单

以更改需要更改的内容以在添加中显示表单

模式vs.和编辑模式(我猜???)。


有没有人对此有任何想法/经验?我确信在真正的OOP

环境中,这是儿童游戏/标准操作程序。请让我

知道你的想法。


Johnny

I have several databases where I have one form to add a new record and one form
to edit an existing record. I use unbound forms and class modules most of the
time.

What I would like to do is have one form that handles both adding a new record
to the database and editing the same type of record. The form would be altered
in the load event to change whatever needs to be changed to show the form
in an "Add" mode vs. and "Edit" mode (I guess???).

Does anyone have any ideas/experience on this? I''m sure in an truly OOP
environment this is childs play/standard operating procedure. Please let me
know what you think.

Johnny

推荐答案

Johnny M < JM ******* @ gmail.com>在留言中写道

news:55 ************************** @ posting.google.c om ...
"Johnny M" <jm*******@gmail.com> wrote in message
news:55**************************@posting.google.c om...
我有几个数据库,我有一个表格可以添加一个新记录和一个
表格来编辑现有记录。我使用未绑定的表单和类模块大部分时间。

我想做的是有一个表单可以处理添加新的
记录
到数据库并编辑相同类型的记录。在加载事件中将更改表单以更改需要更改的内容以在添加中显示表单
。模式vs.和编辑模式(我猜???)。

有没有人对此有任何想法/经验?我确信在真正的OOP
环境中,这是儿童游戏/标准操作程序。请告诉我/
我知道您的想法。
I have several databases where I have one form to add a new record and one
form
to edit an existing record. I use unbound forms and class modules most of
the
time.

What I would like to do is have one form that handles both adding a new
record
to the database and editing the same type of record. The form would be
altered
in the load event to change whatever needs to be changed to show the form
in an "Add" mode vs. and "Edit" mode (I guess???).

Does anyone have any ideas/experience on this? I''m sure in an truly OOP
environment this is childs play/standard operating procedure. Please let
me
know what you think.



当您打开表单时,使用DataMode参数在Add或Edit中打开

模式,取决于您是要添加新记录还是编辑现有的

。如果您正在编辑现有记录,请在OpenArgs参数中传递记录的PK值

,并让您的编辑表单过滤基础的

数据源以查找此信息记录。



When you open the form, use the DataMode argument to open in Add or Edit
mode, depending on whether you want to add a new record or edit an existing
one. If you''re editing an existing record, pass the PK value of the record
in the OpenArgs argument and have your editing form filter the underlying
data source to find this record.



Johnny M写道:
Johnny M wrote:
我有几个数据库,我有一个表格来添加一个新的记录和一个表格
编辑现有记录。我大部分时间都使用未绑定的表单和类模块。
I have several databases where I have one form to add a new record and one form
to edit an existing record. I use unbound forms and class modules most of the
time.




为什么在使用* unbound *表单时应该使用它们

数据?绑定表格很好地完成了这些工作,而且它们都是内置的。


这不是(仅仅)一个批评声明,有时候我没有

就像Access处理各种事件的方式一样,所以我想看看你的链子

的想法。



Why do you use *unbound* forms when they are supposed to operate upon
data? Bound forms do these jobs quite well, and they''re built in.

This is not (merely) a criticising statement, there are times I don''t
like the way Access handles various events so I''d like to see your chain
of thought.


>当您打开表单时,使用DataMode参数在Add或Edit
> When you open the form, use the DataMode argument to open in Add or Edit
模式下打开,具体取决于您是要添加新记录还是编辑现有记录。如果您正在编辑现有记录,请在OpenArgs参数中传递记录的PK值,并让编辑表单过滤基础数据源以查找此记录。
mode, depending on whether you want to add a new record or edit an existing
one. If you''re editing an existing record, pass the PK value of the record
in the OpenArgs argument and have your editing form filter the underlying
data source to find this record.




表格是未绑定的,因此ADD / EDIT模式无关紧要,对吧?另外,我

避免openargs。我使用存储在全局变量中的类来在

表单之间传递信息。


我真的在寻找一种模仿继承的方法。所以,例如,如果我有一个类Document,那么有三个派生类,IDR,NPA和Claim。我想

单个文档表单,根据我实际使用的文件

进行适当更改。在VBA中,我只有三个类模块IDR,

NPA和Claim(当然没有抽象类文档。)我只想知道

如果有人有任何使用表单执行此操作的技术,因此我不必维护

a一堆看起来几乎相同的表单。



The forms are unbound, so the ADD/EDIT mode is irrelevant, right? Also, I
avoid openargs. I use classes stored in global variables to pass info between
forms.

I''m really looking for a way to mimic inheritance. So, for instance, if I have
a class Document, three derived classes, IDR, NPA, and Claim. I would like
a single Document form, that is changed appropriately based on what Document
I''m actually working with. In VBA, I just have the three class modules IDR,
NPA, and Claim (no abstract class Document, of course.) I just want to know
if anyone has any technique to do this with a form so I don''t have to maintain
a bunch of forms that look nearly identical.


这篇关于表格问题 - 如何避免太多!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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