字段设置为零 [英] Field getting set to zero

查看:142
本文介绍了字段设置为零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我能够在专家的帮助下解决我的所有问题...谢谢专家。


然而,现在真的很奇怪了。如你所知,我有两种形式(一种是附加/更新一个表,另一种只是用于搜索记录)。


因为我在上一篇补充新空白的帖子中更正了问题当我关闭搜索表单时,我现在只搜索第一个记录中的一个字段被设置为零时的记录。对于任何一种形式,代码都没有任何内容可以将任何字段设置为零。我不知道它为什么会发生这种情况,正如我所说,它只发生在第一个记录中的一个字段。


关闭表单命令按钮的代码没有显示任何内容导致这个。

OK so I have been able to fix all of my problems with much help from the experts...thank you experts.

However, now something really weird is happening. As you know I have two forms (one appends/updates a table and the other is just for searching records).

Since I corrected the problem from my previous post of adding a new blank record when searching I now how one field in only the first record that is being set to zero when I close the search form. There is nothing oin the code sets any field to zero anywhere for either form. I have no idea why it is happening and it only happens, as I said, to one field in only the first record.

The code for the Close Form command button shows nothing that would cause this.

展开 | 选择 | Wrap | 行号

推荐答案

您插入的新记录会发生这种情况吗?或者从一堆记录中记录#1?


如果你在谈论新记录,那么它可能是该字段的默认值,检查控件'' s''默认值''属性,或者在表格本身中,在设计视图中,那里的字段也有''默认值''属性。
This happens to the new record you insert? Or record #1 out of a bunch of records?

If you''re talking about the new record, then It could be the default value for the field, check the control''s ''Default Value'' property, or in the table itself, in design view, there''s a ''default value'' property for the field there as well.


There'在向导的样板代码中没有任何内容,当然,你已发布了这样做的关闭表单代码。我认为这是与你上一篇文章中的查询问题相关的内容,你不必向我们解释,除了说你有可能修复它。我希望查询仍然存在导致此问题的问题。


零( 0 )是默认值对于Access''表格默认中的数字字段,所以听起来好像你的查询仍然至少有一个半新记录。那就是我在这里寻找罪魁祸首的地方。


Linq ; 0)>
There''s nothing in the Wizard''s boilerplate Close Form code that you''ve posted that''s doing this, of course. I assume it''s something related to the query problem in your last post, which you didn''t bother to explain to us, other than to say that you had presumably fixed it. I expect that the query still has a problem that''s causing this.

Zero (0) is the Default Value for a Numerical field in Access'' Table Def, so it sounds to me as if you still have at least a half-new record being generated by your query. That''s where I''d look for the culprit here.

Linq ;0)>


仅在第一条记录上发生。我走完每一步后检查了桌子;单击关闭表单按钮后,该字段设置为零。


- 当我运行每个查询并在每个查询之后关闭表单时会发生这种情况。

- 当我转到serach表单然后再发生这种情况时只需单击关闭

表单按钮

- 如果我转到搜索表单并单击清除表单按钮确实会发生这种情况

后面跟着关闭表单按钮。只按下Clear

表单按钮时不会发生这种情况。

- 我不必退出数据库并重新打开它以查看更改。


有4个查询可以从相关表单中执行。以下是它们的SQL语句:

Records_Search_Query
It is happening on only the first record. I have stepped through and checked the table after each step; the field is set to zero after I click the Close Form button.

- It happens when I run each query and close the form after each one.
- It does not happen when I go to the serach form and then only click the Close
Form button
- It does happen if I go to the search form and click the Clear Form button
followed by the Close Form button. It does not happen when only the Clear
Form button is pressed.
- I do not have to exit the database and reopen it to see the change.

There are 4 queries that can be executed from the form in question. Here are the SQL statements for them:

Records_Search_Query
< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


这篇关于字段设置为零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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