子表单上的必填字段似乎超过主表单的保存操作 - >建议? [英] Mandatory field on subform seems to trip over save action of main form -> advice?

查看:49
本文介绍了子表单上的必填字段似乎超过主表单的保存操作 - >建议?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含两个子表单的mainform。当我更改主窗体上的字段,然后单击子窗体,我收到一个错误,说我没有填写必填字段。这总共连续弹出3次。在那之后,我正常地接触我的子表单。


如果我在主窗体上没有改变任何东西,或者在点击子窗体之前保存,一切都很好。


因此,看起来在进入子表单之前发生的保存操作也会触发子表单中的保存操作。这对我来说是意想不到的行为。


任何关于如何解决这个问题的建议都会受到欢迎。最糟糕的情况是,我可以将必填字段转换为非必填字段并自行执行检查。

I have a mainform with two subforms. When I change a field on the main form, then click into the subform, I get an error saying I haven''t filled out a mandatory field. This pops up 3 times in a row in total. After that, I get to my subform as normal.

If I don''t change anything on the mainform, or save before I click in the subform, everything is fine.

So, it looks like the save action that happens before going into the subform, also triggers a save action in the subform. That is unexpected behaviour to me.

Any advice on how to fix this would be welcome. Worst case, I can turn the mandatory field into an non-mandatory field and perform a check myself.

推荐答案

在点击之前如何保存?你点击一个背后有代码的按钮吗?如果是这样,那段代码中有什么?为该按钮编程了哪些事件?


Jim
How do you save before you click? Do you click a button that has code behind it? If so, what''s in that code? What events are programmed for that button?

Jim


当您点击子表单时,您是否正在尝试开始新记录或你选择一个当前的记录。
also, when you click on the subform, are you attempting to start a new record or are you selecting a current record.


在主窗体上保存只是标准的Access行为(根据我的理解:当记录在离开记录时变脏时,Access保存更改当。我点击子表单时,在空记录上,会触发一个事件,为用户预先填充一些列(时间戳和用户名),子表单上的最后一个字段,注释字段是必需的,需要由用户手动输入。如前所述,出于某种原因,在用户获得更改以在注释中键入之前,似乎会触发保存操作。这仅在主表单变脏时才会发生。
Saving on the main form is just the standard Access behaviour (from my understanding that is: when the record is dirty on leaving the record, Access saves the changes).

When I click in the subform, on an empty record, an event fires that prepopulates some columns for the user (timestamp and user name), the last field on the subform, a comment field, is mandatory and needs to be manually typed in by the user. As stated before, for some reason, it looks like a save action is fired before the user gets the change to type in a comment. This only happens when the main form is dirty.


这篇关于子表单上的必填字段似乎超过主表单的保存操作 - >建议?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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