为什么主键值为null? [英] Why is primary key value null?

查看:226
本文介绍了为什么主键值为null?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误消息索引或主键不能包含空值弹出即使我没有更新或以其他方式更改主键。为什么会这样?

I''m having the error message "Index or primary key cannot contain null value" pop up even though I haven''t updated or otherwise changed the primary key. Why could this be?

推荐答案

您是否同时使用相关表格?您是否有任何涉及修改数据的代码或宏?
Are you working with related tables at the same time? Do you have any code or macros involved that would be modifying the data?


Nope。表单唯一能做的就是从表中搜索(选择)项目。明天我将尝试两件事:1)删除表并开始一个新表以确保没有设置或其他条件在主键字段中创建一个空单元格2)删除按钮中的代码并关闭表单,因为那是出现错误消息的时候。如果其中一种解决方案有效,请告诉您。
Nope. The only thing the form does is search (select) items from the table. Tomorrow I will try two things: 1) Delete the table and start a new one to make sure that there are no settings or other criteria that make an empty cell in the primary key field 2) Delete the code in the button and close the form, because that is when the error message appears. Will let you know then if either solution works.


如果您的主键不是自动编号,您可能会转移到新记录?如果您在表格中发布表格和代码的设置,也许我们可以更好地排除故障。
If your primary key is not an autonumber, you may be moving to a new record? If you post the settings of your table and the code in your Form, perhaps we could troubleshoot better.


这篇关于为什么主键值为null?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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